code: def __init__(self):
      app.Canvas.__init__(self, keys="interactive", size=(W, H))
  
      self.program = gloo.Program(VERT_SHADER, FRAG_SHADER)
  
      # Set uniform and attribute
      self.program["a_id"] = gloo.VertexBuffer(a_id)
      self.program["a_position"] = gloo.VertexBuffer(a_position)
  
      self.translate = 5
      self.view = translate((0, 0, -self.translate), dtype=np.float32)
      self.model = np.eye(4, dtype=np.float32)
  
      gloo.set_viewport(
          0, 0, self.physical_size[0], self.physical_size[1]
      )
      self.projection = perspective(
          45.0, self.size[0] / float(self.size[1]), 1.0, 1000.0
      )
      self.program["u_projection"] = self.projection
  
      self.program["u_model"] = self.model
      self.program["u_view"] = self.view
  
      self.theta = 0
      self.phi = 0
  
      self.context.set_clear_color("white")
      self.context.set_state("translucent")
  
      self.timer = app.Timer("auto", connect=self.on_timer, start=True)
  
      self.show()
  
file_path: vispy/examples/gloo/display_lines.py
imports: import numpy
  from vispy import gloo
  from vispy import app
  from vispy.util.transforms import perspective, translate, rotate
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()