picogl.renderer.legacy_glmesh

Classes

LegacyGLMesh

GL Mesh fir Compatibility Profile

Module Contents

class picogl.renderer.legacy_glmesh.LegacyGLMesh(vertices: numpy.ndarray, faces: numpy.ndarray, colors: numpy.ndarray | None = None, normals: numpy.ndarray | None = None, uvs: numpy.ndarray | None = None)[source]

GL Mesh fir Compatibility Profile

GPU‐resident mesh: owns VAO/VBO/EBO/CBO/NBO for an indexed triangle mesh. It does not know anything about shaders or matrices.

vertices[source]
colors[source]
normals[source]
uvs[source]
vao: picogl.buffers.vertex.legacy.VertexBufferGroup | None = None[source]
index_count: int = 0[source]
classmethod from_mesh_data(mesh: MeshData) LegacyGLMesh[source]

Construct a GLMesh from a MeshData container.

Parameters:

mesh (MeshData) – Must have .vertices (Nx3), .ebo (Mx1), optional .cbo (Nx3), .nbo (Nx3), uvs (Nx2)

Returns:

Ready-to-upload mesh (GPU buffers are allocated only when upload() is called).

Return type:

LegacyGLMesh

upload() None[source]

Allocate & fill GPU buffers.

generate_dynamic_attributes()[source]

generate_dynamic_attributes

Create layout that matches the VBOs being added

bind()[source]
unbind()[source]
delete()[source]

Free GPU resources.

__enter__()[source]
__exit__(exc_type, exc, tb)[source]
draw(mode=GL_TRIANGLES) None[source]

Draw the mesh.