code: def __init__(self):
      # setup initial width, height
      app.Canvas.__init__(self, keys="interactive", size=(800, 600))
  
      # create a new shader program
      self.program = gloo.Program(
          VERT_SHADER, FRAG_SHADER, count=len(galaxy)
      )
  
      # load the star texture
      self.texture = gloo.Texture2D(
          load_galaxy_star_image(), interpolation="linear"
      )
      self.program["u_texture"] = self.texture
  
      # construct the model, view and projection matrices
      self.view = transforms.translate((0, 0, -5))
      self.program["u_view"] = self.view
  
      self.model = np.eye(4, dtype=np.float32)
      self.program["u_model"] = self.model
  
      self.program["u_colormap"] = colors
  
      w, h = self.size
      self.projection = perspective(45.0, w / float(h), 1.0, 1000.0)
      self.program["u_projection"] = self.projection
  
      # start the galaxy to some decent point in the future
      galaxy.update(100000)
      data = self.__create_galaxy_vertex_data()
  
      # setup the VBO once the galaxy vertex data has been setup
      # bind the VBO for the first time
      self.data_vbo = gloo.VertexBuffer(data)
      self.program.bind(self.data_vbo)
  
      # setup blending
      gloo.set_state(
          clear_color=(0.0, 0.0, 0.03, 1.0),
          depth_test=False,
          blend=True,
          blend_func=("src_alpha", "one"),
      )
  
      self._timer = app.Timer("auto", connect=self.update, start=True)
  
file_path: vispy/examples/demo/gloo/galaxy/galaxy.py
imports: import numpy
  import sys
  from vispy.util.transforms import perspective
  from vispy.util import transforms
  from vispy import gloo
  from vispy import app
  from vispy import io
  import galaxy_specrend
  from galaxy_simulation import Galaxy
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()