PointsTo3D

Use the PointsTo3D node to calculate the 3D location of a 2D point in an image sequence using the parallax between two or three tracked points.

Attach an image and its corresponding tracked camera to the PointsTo3D node inputs. Select the 2D point you want to calculate, place A on that point at a particular frame and click set frame. Now, change the frame to a different camera angle and specify that same 2D feature with B and click set frame. Repeat for point C, again on a different frame. Click calculate to generate the point in 3D space as well as that point converted back to screen space.

Inputs and Controls

Connection Type

Connection Name

Function

Input

cam

A Camera node whose movement matches that of the camera used to shoot the input sequence. This can be a camera you have created using the CameraTracker node or a camera you have imported from a third-party 3D application, for example. Note that the camera must be animated.

img

The image sequence that has a 2D point whose 3D position you want to calculate.

Control (UI)

Knob (Scripting)

Default Value

Function

PointsTo3D Tab

Camera type

cameraMovType

free move

Select the type of tracked camera movement:

free move - this turns a 2D point in the image into a point in 3D space. This requires the camera to be moving and for you to find the 2D point in three frames. Select the 2D point you want to calculate, place Point A on that point at a particular frame and click set frame. Now, change the frame to a different camera angle and specify that same 2D feature with Point B and click set frame. Repeat for Point C, again on a different frame. Click calculate to generate the point in 3D space as well as that point converted back to screen space. You can also click generate axis to make a 3D Axis object with this position.

nodal - this ignores Point B and Point C. Instead, it just puts Point A a fixed distance in front of the camera, using the Camera's focal length to decide the distance.

Point A

2D point xy

pointA

50, 0

Choose a 2D point to track on the X and Y axes.

point ref time

ref_timeA

0

The frame number Point A is set to.

set frame

N/A

N/A

Click to set Point A at the current xy location and frame number.

Point B

2D point xy

pointB

100, 0

Choose a 2D point to track on the X and Y axes.

point ref time

ref_timeB

0

The frame number Point B is set to.

set frame

N/A

N/A

Click to set Point B at the current XY location and frame number.

Point C

2D point xy

pointC

150, 0

Choose a 2D point to track on the X and Y axes.

point ref time

ref_timeC

0

The frame number Point C is set to. You can leave the point ref time set to zero to omit Point C from the computation. You might want to do this if you have a free moving camera but you only want to use Point A and Point B in the calculation.

set frame

N/A

N/A

Click to set Point C at the current XY location and frame number.

Output

Calculate

N/A

N/A

Click to calculate the 3D point coordinates from the 2D point data.

3D point xyz

point3D

0

The calculated X, Y, and Z axis location for the 3D point.

2D point xy

point2D

0

The current X and Y axis location of the point2d marker.

Python Tab (These controls are for Python callbacks and can be used to have Python functions automatically called when various events happen in Nuke.)

before render

beforeRender

none

These functions run prior to starting rendering in execute(). If they throw an exception, the render aborts.

before each frame

beforeFrameRender

none

These functions run prior to starting rendering of each individual frame. If they throw an exception, the render aborts.

after each frame

afterFrameRender

none

These functions run after each frame is finished rendering. They are not called if the render aborts. If they throw an exception, the render aborts.

after render

afterRender

none

These functions run after rendering of all frames is finished. If they throw an error, the render aborts.

render progress renderProgress none These functions run during rendering to determine progress or failure.