picogl.ui.backend.glut.window.textured_mesh

Shared textured-mesh GLUT renderer for tutorial examples (tu02, tu04, …).

Attributes

_MVP_UNIFORM

_TEXTURE_UNIFORM

Classes

TexturedRendererContext

GPU state for a textured mesh draw.

TexturedRendererSpec

Configuration for a textured mesh tutorial window.

TexturedMeshRenderer

GLUT window: textured mesh + tu02/tu04-style interaction.

Functions

rotate_model(rotation, model_matrix) → pyglm.glm.mat4

Apply x/y drag rotation to model_matrix and return it.

Module Contents

picogl.ui.backend.glut.window.textured_mesh._MVP_UNIFORM = 'mvp_matrix'[source]
picogl.ui.backend.glut.window.textured_mesh._TEXTURE_UNIFORM = 'texture0'[source]
picogl.ui.backend.glut.window.textured_mesh.rotate_model(rotation: picogl.ui.backend.glut.mouse.RotationInteraction, model_matrix: pyglm.glm.mat4) → pyglm.glm.mat4[source]

Apply x/y drag rotation to model_matrix and return it.

class picogl.ui.backend.glut.window.textured_mesh.TexturedRendererContext[source]

GPU state for a textured mesh draw.

mvp_id: int | None = None[source]
texture_id: int | None = None[source]
texture_buffer: int | None = None[source]
model: picogl.utils.mesh.protocol.MeshProtocol | None = None[source]
projection_matrix: pyglm.glm.mat4 | None = None[source]
view_matrix: pyglm.glm.mat4 | None = None[source]
model_matrix: pyglm.glm.mat4 | None = None[source]
mvp_matrix: pyglm.glm.mat4 | None = None[source]
class picogl.ui.backend.glut.window.textured_mesh.TexturedRendererSpec[source]

Configuration for a textured mesh tutorial window.

width: int[source]
height: int[source]
title: str[source]
zoom_distance: float[source]
distance_threshold: float[source]
texture_path: pathlib.Path[source]
glsl_dir: pathlib.Path[source]
create_mesh: Callable[[bool], picogl.utils.mesh.protocol.MeshProtocol][source]
require_texture: bool = True[source]
class picogl.ui.backend.glut.window.textured_mesh.TexturedMeshRenderer(spec: TexturedRendererSpec, *args, **kwargs)[source]

Bases: picogl.ui.backend.glut.window.glut.GlutRendererWindow

GLUT window: textured mesh + tu02/tu04-style interaction.

spec[source]
context[source]
shader: picogl.backend.modern.core.shader.program.ShaderProgram | None = None[source]
zoom_distance[source]
distance_threshold[source]
initializeGL() → None[source]

Initial OpenGL configuration.

keyPressEvent(key, x, y) → None[source]

on_keyboard

mousePressEvent(button, state, x, y) → None[source]

mousePressEvent

mouseMoveEvent(x, y) → None[source]

mouseMoveEvent

bind_active_texture0() → None[source]
initialize() → None[source]
calc_mvp(width: int, height: int) → None[source]
update_mvp() → None[source]

Base perspective matrix from your existing method

resizeGL(width, height) → None[source]

resizeGL

paintGL() → None[source]

paintGL