Пример #1
0
  def update(self):
    RiftApp.update(self)
    pressed = pygame.key.get_pressed()

    if pressed[pgl.K_r]:
      self.reset_camera()

    rotation = 0.0
    
    if pressed[pgl.K_q]:
      rotation = +1.0
    if pressed[pgl.K_e]:
      rotation = -1.0
    if (rotation != 0.0):
      self.camera = self.camera * \
        mat4.rotation(rotation * 0.01, vec3(0, 1, 0))
      self.recompose_camera()
       
    # Modify direction vectors for key presses
    translation = vec3()
    if pressed[pgl.K_r]:
      self.rift.recenter_pose()
    if pressed[pgl.K_w]:
      translation.z = -1.0
    elif pressed[pgl.K_s]:
      translation.z = +1.0
    if pressed[pgl.K_a]:
      translation.x = -1.0
    elif pressed[pgl.K_d]:
      translation.x = +1.0
    if (vec3.length(translation) > 0.1):
      translation = self.camera.getMat3() * (translation * 0.005)
      self.camera.translate(translation)
      self.recompose_camera()
Пример #2
0
  def update(self):
    RiftApp.update(self)
    pressed = pygame.key.get_pressed()

    if pressed[pgl.K_r]:
      self.reset_camera()

    rotation = 0.0
    
    if pressed[pgl.K_q]:
      rotation = +1.0
    if pressed[pgl.K_e]:
      rotation = -1.0
    if (rotation != 0.0):
      self.camera = self.camera * \
        mat4.rotation(rotation * 0.01, vec3(0, 1, 0))
      self.recompose_camera()
       
    # Modify direction vectors for key presses
    translation = vec3()
    if pressed[pgl.K_r]:
      self.rift.recenter_pose()
    if pressed[pgl.K_w]:
      translation.z = -1.0
    elif pressed[pgl.K_s]:
      translation.z = +1.0
    if pressed[pgl.K_a]:
      translation.x = -1.0
    elif pressed[pgl.K_d]:
      translation.x = +1.0
    if (vec3.length(translation) > 0.1):
      translation = self.camera.getMat3() * (translation * 0.005)
      self.camera.translate(translation)
      self.recompose_camera()
Пример #3
0
 def init_gl(self):
   RiftApp.init_gl(self)
   glEnable(GL_DEPTH_TEST)
   glDisable(GL_CULL_FACE)
   glClearColor(0.1, 0.1, 0.1, 1)
   self.cube = ColorCube()
Пример #4
0
 def __init__(self):
   RiftApp.__init__(self)
   self.cube_size = 0.2
   self.reset_camera()
Пример #5
0
 def init_gl(self):
   RiftApp.init_gl(self)
   glEnable(GL_DEPTH_TEST)
   glDisable(GL_CULL_FACE)
   glClearColor(0.1, 0.1, 0.1, 1)
   self.cube = ColorCube()
Пример #6
0
 def __init__(self):
   RiftApp.__init__(self)
   self.cube_size = self.rift.get_float(ovr.KEY_IPD, ovr.DEFAULT_IPD)
   self.reset_camera()
Пример #7
0
 def init_gl(self):
   RiftApp.init_gl(self)
   glEnable(GL_DEPTH_TEST)
   glClearColor(0.1, 0.1, 0.1, 1)
Пример #8
0
 def __init__(self):
   RiftApp.__init__(self)
   self.cube_size = self.hmd.get_float(
     ovr.OVR_KEY_IPD, ovr.OVR_DEFAULT_IPD)
   self.reset_camera()
Пример #9
0
 def init_gl(self):
     RiftApp.init_gl(self)
     glEnable(GL_DEPTH_TEST)
     glClearColor(0.1, 0.1, 0.1, 1)