Name

perspective()

Examples
# Re-creates the default perspective
size(100, 100, P3D)
noFill()
fov = PI / 3.0
cameraZ = (height / 2.0) / tan(fov / 2.0)
perspective(fov, float(width) / float(height),
            cameraZ / 10.0, cameraZ * 10.0)
translate(50, 50, 0)
rotateX(-PI / 6)
rotateY(PI / 3)
box(45)
Description
Syntax
perspective()
perspective(fovy, aspect, zNear, zFar)
Parameters
fovy
aspect
zNear
zFar
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License