Skip to content

Line 2D 3D

theproadam edited this page Apr 24, 2020 · 2 revisions

To render a line in screenspace or world space, renderXF provides Line3D() and Line2D() functions.

Drawing in screenspace

To draw in screenspace, use the Line2D() function from the renderX instance.

GL.Line2D(fromX, fromY, toX, toY, R, G, B);

Drawing in worldspace

To draw in worldspace, use the Line3D() function from the renderX instance. The Line3D() function uses Vector3s. The rotation and position data is supplied from the internal vertex shader. The ForceCameraPosition() and ForceCameraRotation() functions can be used to position the line.

GL.Line3D(VectorFrom, VectorTo, R, G, B);