Skip to main content

perspective

perspective() 

Set-up a perspective projection environment.

Coordinates are transformed by a view matrix and then projected with perspective division:

and

, where

in view space.

By default this uses the same isometric camera angles as ortho, but with perspective foreshortening.

perspective({
on-xz({
rect((-1,-1), (1,1))
})
})

X-axis rotation angle

Y-axis rotation angle

Z-axis rotation angle

distance:

Distance from camera to scene origin. auto derives a stable value from scene depth.

sorted:

Sort drawables by depth (back to front)

cull-face:

none or str

Enable back-face culling if set to "cw" for clockwise or "ccw" for counter-clockwise. Polygons of the specified order will not get drawn.

reset-transform:

Ignore the current transformation matrix

Elements to draw