picogl.backend.modern.core.shader.mvp.helpers

Set up model_matrix view projection (MVP) matrix for 3D rendering.

This function constructs a combined projection and view matrix based on camera orbit angles, zoom level, and viewport aspect ratio. It simulates a camera orbiting around the origin and returns a 4x4 transformation matrix suitable for use in OpenGL shaders.

Example:

mvp_parameters = setup_mvp(angle_x=0.5, angle_y=1.0, zoom=1.2, aspect=16/9)

Functions

setup_mvp(→ pyglm.glm.mat4)

setup_mvp

np_setup_mvp(→ numpy.ndarray)

setup_mvp

Module Contents

picogl.backend.modern.core.shader.mvp.helpers.setup_mvp(angle_x: float, angle_y: float, zoom: float, aspect: float) pyglm.glm.mat4[source]

setup_mvp

Parameters:
  • angle_x (float) – Rotation angle around the X-axis (in radians).

  • angle_y (float) – Rotation angle around the Y-axis (in radians).

  • zoom (float) – Zoom factor controlling camera distance.

  • aspect (float) – Aspect ratio of the viewport (width / height).

Returns:

Combined projection * view matrix.

Return type:

glm.mat4

picogl.backend.modern.core.shader.mvp.helpers.np_setup_mvp(shader, width, height, angle_x, angle_y, zoom) numpy.ndarray[source]

setup_mvp

Returns:

ndarray[Any, dtype[bool_]]