picogl.backend.legacy.core.camera.matrices.setup
This module provides a helper function to retrieve transformation matrices from the OpenGL state machine. It uses glGetFloatv to query matrices such as the modelview or projection matrix and returns them in a format compatible with GLSL.
Dependencies:
numpy
PyOpenGL
Functions:
Parameters:
mode: OpenGL matrix mode (e.g., GL_MODELVIEW_MATRIX, GL_PROJECTION_MATRIX).
Returns:
A NumPy array of shape (4, 4) representing the requested matrix.
Usage Example:
modelview_matrix = get_matrix(GL_MODELVIEW_MATRIX)
projection_matrix = get_matrix(GL_PROJECTION_MATRIX)
Functions
|
setup_matrices |