Skip to main content

vArrayLookAt

Outputs a direction, Euler angles or a 9-value basis from each point toward a target.

IntermediateMograph / ArrayArrayScriptValJSON
vArrayLookAt node

vArrayLookAt takes an array of points and a target, and writes one result per point. The target is set by Target X, Y and Z, or comes from a Targets array with one target per point.

Parameters​

ParameterTypeDefaultDescription
Target XFloat0X of the target. Default 0.
Target YFloat0Y of the target. Default 0.
Target ZFloat0Z of the target. Default 0.
Forward AxisDropdown+Z (default)+Z (default), -Z (flip), +Y, -Y, +X or -X. Re-maps the components of the direction vector.
Invert DirectionInteger0Reverses the direction. Default off.
+8 more parameters
ParameterTypeDefaultDescription
NormalizeInteger1Makes the direction unit length when on (default).
Up XInteger0X of the up vector, 0 or 1. Used in Full Basis mode. Default 0.
Up YInteger1Y of the up vector, 0 or 1. Used in Full Basis mode. Default 1.
Up ZInteger0Z of the up vector, 0 or 1. Used in Full Basis mode. Default 0.
Output ModeDropdownDirection VectorDirection Vector (default), Euler Angles (pitch, yaw, 0, in degrees) or Full Basis (9 values).
Per-Point TargetInteger0Reads one target per point from Targets when on. Default off. The Targets port is shown only then.
PointsDATATYPE—The points to aim from.
TargetsDATATYPE—Optional target points, one per input point. Used when Per-Point Target is on.
Read the full description

For each point the direction is target - point, made unit length if Normalize is on (the default). Forward Axis then re-maps its components, and Invert Direction flips it. Direction Vector outputs these three values. Euler Angles outputs pitch and yaw in degrees and a roll of 0.

Full Basis outputs nine values: the forward vector, a right vector from the cross product of the up vector (Up X, Y, Z, default 0, 1, 0) and forward, and a third vector from forward and right.

With Per-Point Target on, target i comes from the Targets input. A missing or invalid value falls back to Target X, Y and Z. A zero direction gives 0, 0, 0 when Normalize is on.

Example Connections​

vArrayPointsOnGrid.Output -> vArrayLookAt.Points
vArrayLookAt.Output -> vArrayCameraProjection.ArrayA