This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name

beginCamera()

Examples
example pic
size(100, 100, P3D);
noFill();

beginCamera();
camera();
rotateX(-PI/6);
endCamera();

translate(50, 50, 0);
rotateY(PI/3);
box(45);
Description The beginCamera() and endCamera() functions enable advanced customization of the camera space. The functions are useful if you want to more control over camera movement, however for most users, the camera() function will be sufficient.

The camera functions will replace any transformations (such as rotate() or translate()) that occur before them in draw(), but they will not automatically replace the camera transform itself. For this reason, camera functions should be placed at the beginning of draw() (so that transformations happen afterwards), and the camera() function can be used after beginCamera() if you want to reset the camera before applying transformations.

This function sets the matrix mode to the camera matrix so calls such as translate(), rotate(), applyMatrix() and resetMatrix() affect the camera. beginCamera() should always be used with a following endCamera() and pairs of beginCamera() and endCamera() cannot be nested.
Syntax
beginCamera()
Returnsvoid
Relatedcamera()
endCamera()
applyMatrix()
resetMatrix()
translate()
scale()
Updated on May 19, 2014 05:30:01pm PDT

Creative Commons License