pygfx.objects.Mesh
- class pygfx.objects.Mesh(geometry=None, material=None, *args, **kwargs)
Bases:
WorldObjectA 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. Must contain at least a “positions” and “indices” buffers. Depending on the usage of the material, can also include buffers “normals”, “colors”, “texcoords”, “texcoords2”, etc. Advanced use of meshes also support “tangents”, “skin_indices”, and “skin_weights”.
material (Material) – The data defining the appearance of the object.
visible (bool) – Whether the object is visible.
render_order (int) – Affects the order in which objects are rendered.
position (Vector) – The position of the object in the world. Default (0, 0, 0).
- property morph_target_influences
An ndarray of weights typically from 0-1 that specify how much of the morph is applied.
Note: When using this attribute, its geometry needs to have the relevant attributes of morph targets.
- property morph_target_names
A list of names for the morph targets.