Skip to main content

vScriptValCameraProjection

Rotates, shifts and scales points, then projects them to 2D with a perspective divide.

IntermediateMograph / ScriptValScriptValArrayJSON
vScriptValCameraProjection node

vScriptValCameraProjection takes an array of XYZ points and outputs 2D points. It also outputs an Edges array for the points and passes a Groups input through. The output feeds vScriptValShapeRender.

Parameters​

ParameterTypeDefaultDescription
X OffsetFloat—Added to the X value of every point before projection. Default 0.
Y OffsetFloat—Added to the Y value of every point before projection. Default 0.
Z OffsetFloat1.0Added to the Z value of every point before the divide by Z. Default 1.
Rotation OrderDropdownXYZHidden control, not read by the code. The rotation order is always X, Y, Z.
X RotationFloat—Rotation around X in degrees, slider to 360. Default 0.
+17 more parameters
ParameterTypeDefaultDescription
Y RotationFloat—Rotation around Y in degrees, slider to 360. Default 0.
Z RotationFloat—Rotation around Z in degrees, slider to 360. Default 0.
Rotate Around CenterInteger1Rotates around the centroid of the points when on (default), around the origin when off.
Lock X/YInteger1When on (default), X Scale is used for both X and Y. Y Scale is shown when it is off.
X ScaleFloat1.0Multiplies X and Z. Default 1. Also multiplies Y while Lock X/Y is on.
Y ScaleFloat1.0Multiplies Y when Lock X/Y is off. Default 1. Hidden while it is on.
Field of viewFloat90.0Field of view in degrees. Default 90.
Screen aspect ratioFloat16 / 9Hidden. Screen aspect ratio, default 16 / 9. It cancels out of the X result.
Near clipping planeFloat0.1Hidden. Near clipping plane, default 0.1. Read but not used in the projection.
Far clipping planeFloat1000Hidden. Far clipping plane, default 1000. Read but not used in the projection.
X ShearFloat0.0Hidden. Default 0. Read but not used.
Y ShearFloat0.0Hidden. Default 0. Read but not used.
InputScriptVal—Data to process.
EdgeScriptVal—ScriptVal family. Optional edges. When connected, they are passed to the Edges output.
GroupsScriptVal—ScriptVal family. Optional groups. Passed to the Groups output unchanged.
Auto Create EdgesInteger1When on (default) and no Edge input is connected, writes one edge through all points. Needs 2 or more points.
Close Edge LoopInteger0Default off. When on, the generated edge returns to the first point. When off, it ends at the last point.
Read the full description

Each point is rotated by X, Y and Z Rotation (degrees, in the order X, Y, Z) around the centroid of the points, or the origin if Rotate Around Center is off. Then X, Y and Z Offset are added, X Scale multiplies X and Z, and Y Scale multiplies Y.

With s = 1 / tan(fov / 2), the output is X = 0.5 + s * x / (2 * -z) and Y = s * y / (2 * -z) plus an offset from an internal reference image. A Z near 0 is replaced by a small number.

An Edge input is passed to the Edges output. Without one, Auto Create Edges (on) writes one edge through all points in order, and it returns to point 1 when Close Edge Loop is on. Groups pass through unchanged.

Example Connections​

vScriptValPointsOnCircle.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input