begin_camera() and Py5Graphics.end_camera() functions enable advanced customization of the camera space.
begin_camera() and Py5Graphics.end_camera() 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 Py5Graphics.camera() function will be sufficient. The camera functions will replace any transformations (such as Py5Graphics.rotate() or Py5Graphics.translate()) that occur before them, but they will not automatically replace the camera transform itself. For this reason, camera functions should be placed right after the call to Py5Graphics.begin_draw() (so that transformations happen afterwards), and the Py5Graphics.camera() function can be used after
begin_camera() if you want to reset the camera before applying transformations.
This function sets the matrix mode to the camera matrix so calls such as Py5Graphics.translate(), Py5Graphics.rotate(), Py5Graphics.apply_matrix() and Py5Graphics.reset_matrix() affect the camera.
begin_camera() should always be used with a following Py5Graphics.end_camera() and pairs of
begin_camera() and Py5Graphics.end_camera() cannot be nested.
Underlying Java method: PGraphics.beginCamera
begin_camera() -> None
Updated on September 11, 2021 16:51:34pm UTC