Skip to main content

vJSONLine

Generate evenly spaced points on a straight line between a start and an end position.

BeginnerMograph / JSONJSONArrayScriptVal
vJSONLine node

vJSONLine has no input and outputs an array of XYZ points between Start and End positions. Point Count sets how many points are written.

Parameters​

ParameterTypeDefaultDescription
Start XFloat-0.5X position of the first point. Default -0.5.
Start YFloat0Y position of the first point. Default 0.
Start ZFloat0Z position of the first point. Default 0.
End XFloat0.5X position of the end of the line. Default 0.5.
End YFloat0Y position of the end of the line. Default 0.
+3 more parameters
ParameterTypeDefaultDescription
End ZFloat0Z position of the end of the line. Default 0.
Point CountInteger10Number of points. Clamped to 2 or more, default 10.
Include End PointInteger1.0When on, the last point lands on the end position. When off, the points stop one step before it. Default on.
Read the full description

For point i of n, the node uses t = i / (n - 1) and writes Start + (End - Start) * t on each of the three axes. The first point is at the start position and, with Include End Point on, the last point is at the end position.

With the defaults (Start -0.5, 0, 0, End 0.5, 0, 0, 10 points, Include End Point on) the node outputs ten points on the X axis from -0.5 to 0.5, 0.111 apart.

With Include End Point off, t is divided by n instead of n - 1. The spacing is then (End - Start) / n and the last point stops one step before the end position.

Point Count is clamped to 2 or more. The start and end positions are not limited. The output contains points only, with no edges.

Example Connections​

vJSONLine.Output -> vJSONCameraProjection.ArrayA
vJSONCameraProjection.Output -> vJSONShapeRender.ArrayPoint
Background.Output -> vJSONShapeRender.Input