WorldToScreen

Project a 3D world position to 2D screen space.

Syntax

Susano.WorldToScreen(x, y, z) -> boolean, number, number

Parameters

circle-info

x (number): World X.

y (number): World Y.

z (number): World Z.

Return(s)

circle-info

ok (boolean): true if the point projects in front of the camera, else false.

sx (number): Screen X in pixels.

sy (number): Screen Y in pixels.

Behavior

circle-info

Returns ok=false when the point is behind the camera or projection invalid.

Does not clamp; sx, sy can be outside the visible bounds when off-screen.

Coordinates are suitable for Susano.Draw* functions.

Example(s)

Last updated