picogl.core.camera ================== .. py:module:: picogl.core.camera .. autoapi-nested-parse:: Shared camera defaults used by Qt, GLUT, and backend projection helpers. Attributes ---------- .. autoapisummary:: picogl.core.camera.FOVY picogl.core.camera.DEFAULT_CAMERA_CONFIG Classes ------- .. autoapisummary:: picogl.core.camera.ProjectionConfig picogl.core.camera.CameraParameters picogl.core.camera.CameraConfig Module Contents --------------- .. py:class:: ProjectionConfig Perspective projection parameters used by PicoGL camera helpers. .. py:attribute:: fovy :type: float :value: 45.0 .. py:attribute:: aspect :type: float :value: 1.0 .. py:attribute:: near :type: float :value: 5.0 .. py:attribute:: far :type: float :value: 1000.0 .. py:method:: with_aspect(aspect: float) -> ProjectionConfig Return a copy with ``aspect`` set. .. py:method:: with_size(width: float, height: float) -> ProjectionConfig Return a copy with aspect from ``width / max(height, 1)``. .. py:method:: matrix(aspect: float | None = None) -> pyglm.glm.mat4 Build a perspective projection matrix. If *aspect* is given, use it without mutating this config. .. py:data:: FOVY :value: 45.0 .. py:class:: CameraParameters Look-at parameters that build a view matrix. Example:: camera = CameraParameters(eye=glm.vec3(4, 3, zoom_distance)) view = camera.view_matrix() .. py:attribute:: eye :type: pyglm.glm.vec3 .. py:attribute:: center :type: pyglm.glm.vec3 .. py:attribute:: up :type: pyglm.glm.vec3 .. py:method:: view_matrix() -> pyglm.glm.mat4 Build the view matrix for this look-at triple. .. py:method:: tutorial(distance: float = 3.0, *, z_sign: float = 1.0) -> CameraParameters :classmethod: OpenGL-tutorial style eye at ``(4, 3, z_sign * distance)``. .. py:class:: CameraConfig Bundled camera pose plus projection settings. .. py:attribute:: position :type: pyglm.glm.vec3 .. py:attribute:: target :type: pyglm.glm.vec3 .. py:attribute:: up :type: pyglm.glm.vec3 .. py:attribute:: projection :type: ProjectionConfig .. py:method:: camera_parameters() -> CameraParameters Look-at triple for this camera (ignores projection). .. py:data:: DEFAULT_CAMERA_CONFIG