vispy.visuals.instanced_mesh module#

An instanced version of MeshVisual with arbitrary shifts, transforms, and colors.

class vispy.visuals.instanced_mesh.InstancedMeshVisual(*args, instance_positions, instance_transforms, instance_colors=None, **kwargs)#

Bases: MeshVisual

Instanced Mesh visual.

Mostly identical to MeshVisual, but additionally takes arrays of of positions and transforms (optionally colors) to create multiple instances of the mesh.

Instancing is a rendering technique that re-uses the same mesh data by applying transformations to vertices and vertex data or textures, wich can drastically improve performance compared to having many simple MeshVisuals.

instance_positions(I, 3) array

Coordinates for each instance of the mesh.

instance_transforms(I, 3, 3) array

Matrices for the transforms to apply to each instance.


Matrices of colors for each instance. Colors


Positional arguments to pass to MeshVisual.


Keyword arguments to pass to MeshVisual.


See example scene/ in the gallery.

property instance_colors#
property instance_positions#
property instance_transforms#