picogl.ui.backend.glut.window.textured_mesh =========================================== .. py:module:: picogl.ui.backend.glut.window.textured_mesh .. autoapi-nested-parse:: Shared textured-mesh GLUT renderer for tutorial examples (tu02, tu04, …). Attributes ---------- .. autoapisummary:: picogl.ui.backend.glut.window.textured_mesh._MVP_UNIFORM picogl.ui.backend.glut.window.textured_mesh._TEXTURE_UNIFORM Classes ------- .. autoapisummary:: picogl.ui.backend.glut.window.textured_mesh.TexturedRendererContext picogl.ui.backend.glut.window.textured_mesh.TexturedRendererSpec picogl.ui.backend.glut.window.textured_mesh.TexturedMeshRenderer Functions --------- .. autoapisummary:: picogl.ui.backend.glut.window.textured_mesh.rotate_model Module Contents --------------- .. py:data:: _MVP_UNIFORM :value: 'mvp_matrix' .. py:data:: _TEXTURE_UNIFORM :value: 'texture0' .. py:function:: rotate_model(rotation: picogl.ui.backend.glut.mouse.RotationInteraction, model_matrix: pyglm.glm.mat4) -> pyglm.glm.mat4 Apply x/y drag rotation to *model_matrix* and return it. .. py:class:: TexturedRendererContext GPU state for a textured mesh draw. .. py:attribute:: mvp_id :type: int | None :value: None .. py:attribute:: texture_id :type: int | None :value: None .. py:attribute:: texture_buffer :type: int | None :value: None .. py:attribute:: model :type: picogl.utils.mesh.protocol.MeshProtocol | None :value: None .. py:attribute:: projection_matrix :type: pyglm.glm.mat4 | None :value: None .. py:attribute:: view_matrix :type: pyglm.glm.mat4 | None :value: None .. py:attribute:: model_matrix :type: pyglm.glm.mat4 | None :value: None .. py:attribute:: mvp_matrix :type: pyglm.glm.mat4 | None :value: None .. py:class:: TexturedRendererSpec Configuration for a textured mesh tutorial window. .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:attribute:: title :type: str .. py:attribute:: zoom_distance :type: float .. py:attribute:: distance_threshold :type: float .. py:attribute:: texture_path :type: pathlib.Path .. py:attribute:: glsl_dir :type: pathlib.Path .. py:attribute:: create_mesh :type: Callable[[bool], picogl.utils.mesh.protocol.MeshProtocol] .. py:attribute:: require_texture :type: bool :value: True .. py:class:: TexturedMeshRenderer(spec: TexturedRendererSpec, *args, **kwargs) Bases: :py:obj:`picogl.ui.backend.glut.window.glut.GlutRendererWindow` GLUT window: textured mesh + tu02/tu04-style interaction. .. py:attribute:: spec .. py:attribute:: context .. py:attribute:: shader :type: picogl.backend.modern.core.shader.program.ShaderProgram | None :value: None .. py:attribute:: zoom_distance .. py:attribute:: distance_threshold .. py:method:: initializeGL() -> None Initial OpenGL configuration. .. py:method:: keyPressEvent(key, x, y) -> None on_keyboard .. py:method:: mousePressEvent(button, state, x, y) -> None mousePressEvent .. py:method:: mouseMoveEvent(x, y) -> None mouseMoveEvent .. py:method:: bind_active_texture0() -> None .. py:method:: initialize() -> None .. py:method:: calc_mvp(width: int, height: int) -> None .. py:method:: update_mvp() -> None Base perspective matrix from your existing method .. py:method:: resizeGL(width, height) -> None resizeGL .. py:method:: paintGL() -> None paintGL