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: ๐‘ฅโ€ฒ=๐‘‘refโˆ—๐‘ฅ๐‘ค and ๐‘ฆโ€ฒ=๐‘‘refโˆ—๐‘ฆ๐‘ค, where ๐‘ค=max(โˆ’๐‘ง,near) 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