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

vJSONLookAt 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
| Parameter | Type | Default | Description |
|---|---|---|---|
| Target X | Float | 0 | X of the target. Default 0. |
| Target Y | Float | 0 | Y of the target. Default 0. |
| Target Z | Float | 0 | Z of the target. Default 0. |
| Forward Axis | Dropdown | +Z (default) | +Z (default), -Z (flip), +Y, -Y, +X or -X. Re-maps the components of the direction vector. |
| Invert Direction | Integer | 0 | Reverses the direction. Default off. |
+8 more parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Normalize | Integer | 1 | Makes the direction unit length when on (default). |
| Up X | Integer | 0 | X of the up vector, 0 or 1. Used in Full Basis mode. Default 0. |
| Up Y | Integer | 1 | Y of the up vector, 0 or 1. Used in Full Basis mode. Default 1. |
| Up Z | Integer | 0 | Z of the up vector, 0 or 1. Used in Full Basis mode. Default 0. |
| Output Mode | Dropdown | Direction Vector | Direction Vector (default), Euler Angles (pitch, yaw, 0, in degrees) or Full Basis (9 values). |
| Per-Point Target | Integer | 0 | Reads one target per point from Targets when on. Default off. The Targets port is shown only then. |
| Points | DATATYPE | — | The points to aim from. |
| Targets | DATATYPE | — | 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
- Aim a grid at a point
- Aim each point at its own target
vJSONPointsOnGrid.Output -> vJSONLookAt.Points
vJSONLookAt.Output -> vJSONCameraProjection.ArrayA
vJSONPointsOnCircle.Output -> vJSONLookAt.Points
vJSONPointsOnGrid.Output -> vJSONLookAt.Targets
vJSONLookAt.Output -> vJSONTranslate.Input