begin-camera

camera

end-camera

frustum

ortho

perspective

print-camera

print-projection

begin-camera

Arguments
[]
Docstring
Sets the matrix mode to the camera matrix so calls such as
translate, rotate, apply-matrix and reset-matrix affect the
camera. begin-camera should always be used with a following
end-camera and pairs of begin-camera and end-camera cannot be
nested.

For most situations the camera function will be sufficient.
Works only inside sketch functions?
Yes
Original Processing method
beginCamera()

camera

Arguments
[][eyeX eyeY eyeZ centerX centerY centerZ upX upY upZ]
Docstring
Sets the position of the camera through setting the eye position,
the center of the scene, and which axis is facing upward. Moving the
eye position and the direction it is pointing (the center of the
scene) allows the images to be seen from different angles. The
version without any parameters sets the camera to the default
position, pointing to the center of the display window with the Y
axis as up. The default values are:

eyeX:     (/ (width) 2.0)
eyeY:     (/ (height) 2.0)
eyeZ:     (/ (/ (height) 2.0) (tan (/ (* Math/PI 60.0) 360.0)))
centerX:  (/ (width) 2.0)
centerY:  (/ (height) 2.0)
centerZ:  0
upX:      0
upY:      1
upZ:      0

Similar imilar to gluLookAt() in OpenGL, but it first clears the
current camera settings.
Works only inside sketch functions?
Yes
Original Processing method
camera()

end-camera

Arguments
[]
Docstring
Unsets the matrix mode from the camera matrix. See begin-camera.
Works only inside sketch functions?
Yes
Original Processing method
endCamera()

frustum

Arguments
[left right bottom top near far]
Docstring
Sets a perspective matrix defined through the parameters. Works
like glFrustum, except it wipes out the current perspective matrix
rather than muliplying itself with it.
Works only inside sketch functions?
Yes
Original Processing method
frustum()

ortho

Arguments
[][left right bottom top][left right bottom top near far]
Docstring
Sets an orthographic projection and defines a parallel clipping
volume. All objects with the same dimension appear the same size,
regardless of whether they are near or far from the camera. The
parameters to this function specify the clipping volume where left
and right are the minimum and maximum x values, top and bottom are
the minimum and maximum y values, and near and far are the minimum
and maximum z values. If no parameters are given, the default is
used: (ortho 0 width 0 height -10 10)
Works only inside sketch functions?
Yes
Original Processing method
ortho()

perspective

Arguments
[][fovy aspect z-near z-far]
Docstring
Sets a perspective projection applying foreshortening, making
distant objects appear smaller than closer ones. The parameters
define a viewing volume with the shape of truncated pyramid. Objects
near to the front of the volume appear their actual size, while
farther objects appear smaller. This projection simulates the
perspective of the world more accurately than orthographic
projection. The version of perspective without parameters sets the
default perspective and the version with four parameters allows the
programmer to set the area precisely. The default values are:
perspective(PI/3.0, width/height, cameraZ/10.0, cameraZ*10.0) where
cameraZ is ((height/2.0) / tan(PI*60.0/360.0));
Works only inside sketch functions?
Yes
Original Processing method
perspective()