code: def on_resize(self, event):
      # setup the new viewport
      gloo.set_viewport(0, 0, *event.physical_size)
      # recompute the projection matrix
      w, h = event.size
      self.projection = perspective(45.0, w / float(h), 1.0, 1000.0)
      self.program["u_projection"] = self.projection
  
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 3 for calling the Canvas obj's underlying member method code with example usage: obj.on_resize(event) without return types