Skip to main content

vJSONTranslate

Adds an XYZ offset to every point, then multiplies it by a scale.

BeginnerMograph / JSONJSONArrayScriptVal
vJSONTranslate node

vJSONTranslate takes an array of XYZ points and outputs (point + offset) * scale for each axis. X Scale is used for X and Z, and for Y while Lock X/Y is on. Y Scale is used for Y when Lock X/Y is off.

Parameters​

ParameterTypeDefaultDescription
X OffsetFloat—Added to X before the scale. Default 0.
Y OffsetFloat—Added to Y before the scale. Default 0.
Z OffsetFloat—Added to Z before the scale. Default 0.
Lock X/YInteger1When on (default), Y uses X Scale and Y Scale is hidden. When off, Y Scale is used for Y.
X ScaleFloat1.0Multiplies X and Z after the offset. Default 1. Also multiplies Y while Lock X/Y is on.
+3 more parameters
ParameterTypeDefaultDescription
Y ScaleFloat1.0Multiplies Y after the offset when Lock X/Y is off. Default 1. Hidden while it is on.
InputDATATYPE—Points to move.
Show InputInteger0.0Shows the input ports of the offsets and scales when on. Default off.
Read the full description

Each point becomes ((x + X Offset) * X Scale, (y + Y Offset) * Y Scale, (z + Z Offset) * X Scale). The offsets default to 0 and the scales to 1, so the default leaves the points unchanged. Because the scale is applied after the offset, it also scales the offset.

Lock X/Y is on by default. While it is on, Y Scale is hidden and Y uses X Scale. With it off, Y Scale scales Y on its own. Show Input exposes the offsets and scales as input ports. Elements that are not lists of at least 3 values are dropped, and the output points have 3 values.

Example Connections​

vJSONPointsOnGrid.Output -> vJSONTranslate.ArrayA
vJSONTranslate.Output -> vJSONCameraProjection.ArrayA
vJSONCameraProjection.Output -> vJSONShapeRender.ArrayPoint
Background.Output -> vJSONShapeRender.Input