pygfx.objects.Mesh
- class pygfx.objects.Mesh(geometry=None, material=None, *, visible=True, render_order=0, render_mask='auto', name='')
Bases:
WorldObject
A mesh.
An object consisting of triangular faces represented by a set of vertices (3D positions) and a set of vertex indices indicating which vertex triplets form mesh triangles.
The picking info of a Mesh (the result of
renderer.get_pick_info()
) will for most materials includeinstance_index
(int),face_index
(int), andface_coord
(tuple of 3 floats). The latter are the barycentric coordinates for each vertex of the face (with values 0..1).- Parameters:
geometry (Geometry) – The data defining the shape of the object.
material (Material) – The data defining the appearance of the object.
visible (bool) – Whether the object is visible.
render_order (int) – The render order (when applicable for the renderer’s blend mode).
render_mask (str) – Determines the render passes that the object is rendered in. It’s recommended to let the renderer decide, using “auto”.
position (Vector) – The position of the object in the world. Default (0, 0, 0).
Examples
Transform Control without Matrix Updating
Gizmo to transform world objects
Displaying an image in a scene
Validate transparency with and without bg
Validate transparency for the ordered2 blend mode
Volume and Volume Slice Rendering
Showing CPU usage in the title bar