code: def __init__(
      self,
      vertices,
      faces,
      positions,
      colors,
      transforms,
      subdivisions=5,
  ):
      visuals.Visual.__init__(self, vertex_shader, fragment_shader)
  
      self.set_gl_state("translucent", depth_test=True, cull_face=True)
      self._draw_mode = "triangles"
  
      # set up vertex and index buffer
      self.vbo = gloo.VertexBuffer(vertices.astype(np.float32))
      self.shared_program.vert["position"] = self.vbo
      self._index_buffer = gloo.IndexBuffer(
          data=faces.astype(np.uint32)
      )
  
      # create a vertex buffer with a divisor argument of 1. This means that the
      # attribute value is set to the next element of the array every 1 instance.
      # The length of the array multiplied by the divisor determines the number
      # of instances
      self.shifts = gloo.VertexBuffer(
          positions.astype(np.float32), divisor=1
      )
      self.shared_program["shift"] = self.shifts
  
      # vispy does not handle matrix attributes (likely requires some big changes in GLIR)
      # so we decompose it into three vec3; (column vectors of the matrix)
      transforms = transforms.astype(np.float32)
      self.transforms_x = gloo.VertexBuffer(
          transforms[..., 0].copy(), divisor=1
      )
      self.transforms_y = gloo.VertexBuffer(
          transforms[..., 1].copy(), divisor=1
      )
      self.transforms_z = gloo.VertexBuffer(
          transforms[..., 2].copy(), divisor=1
      )
      self.shared_program["transform_x"] = self.transforms_x
      self.shared_program["transform_y"] = self.transforms_y
      self.shared_program["transform_z"] = self.transforms_z
  
      # we can provide additional buffers with different divisors, as long as the
      # amount of instances (length * divisor) is the same. In this case, we will change
      # color every 5 instances
      self.color = gloo.VertexBuffer(
          colors.astype(np.float32), divisor=1
      )
      self.shared_program["color"] = self.color
  
file_path: vispy/examples/scene/instanced_mesh.py
imports: from vispy import app, gloo, visuals, scene, use
  import numpy
  from scipy.spatial.transform import Rotation
  from vispy.io import read_mesh, load_data_file
label_desc: Use image node_id 1 to create a new InstancedMeshVisual object from inherited base classes: visuals with example: obj = InstancedMeshVisual(vertices, faces, positions, colors, transforms, subdivisions)