Creates a new p5.Camera object to use with the framebuffer.
The new camera is initialized with a default position (0, 0, 800)
and a default perspective projection. Its properties can be controlled with p5.Camera methods such as myCamera.lookAt(0, 0, 0)
.
Framebuffer cameras should be created between calls to myBuffer.begin() and myBuffer.end() like so:
let myCamera;
myBuffer.begin();
// Create the camera for the framebuffer.
myCamera = myBuffer.createCamera();
myBuffer.end();
Calling setCamera() updates the framebuffer's projection using the camera. resetMatrix() must also be called for the view to change properly:
myBuffer.begin();
// Set the camera for the framebuffer.
setCamera(myCamera);
// Reset all transformations.
resetMatrix();
// Draw stuff...
myBuffer.end();
Examples
Syntax
createCamera()
Parameters
Returns
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.