Example #1
0
 def autoscale(self):
     self.cam.lookat[0] = self.model.stat.center[0]
     self.cam.lookat[1] = self.model.stat.center[1]
     self.cam.lookat[2] = self.model.stat.center[2]
     self.cam.distance = 1.0 * self.model.stat.extent
     self.cam.camid = -1
     self.cam.trackbodyid = -1
     if self.window:
         width, height = glfw.get_framebuffer_size(self.window)
         mjlib.mjv_updateCameraPose(byref(self.cam), width * 1.0 / height)
Example #2
0
 def autoscale(self):
     self.cam.lookat[0] = self.model.stat.center[0]
     self.cam.lookat[1] = self.model.stat.center[1]
     self.cam.lookat[2] = self.model.stat.center[2]
     self.cam.distance = 1.0 * self.model.stat.extent
     self.cam.camid = -1
     self.cam.trackbodyid = -1
     if self.window:
         width, height = glfw.get_framebuffer_size(self.window)
         mjlib.mjv_updateCameraPose(byref(self.cam), width * 1.0 / height)
Example #3
0
 def render(self):
     rect = self.get_rect()
     arr = (ctypes.c_double * 3)(0, 0, 0)
     mjlib.mjv_makeGeoms(self.model.ptr, self.data.ptr, byref(self.objects),
                         byref(self.vopt), mjCAT_ALL, 0, None, None,
                         ctypes.cast(arr, ctypes.POINTER(ctypes.c_double)))
     mjlib.mjv_setCamera(self.model.ptr, self.data.ptr, byref(self.cam))
     mjlib.mjv_updateCameraPose(byref(self.cam),
                                rect.width * 1.0 / rect.height)
     mjlib.mjr_render(0, rect, byref(self.objects), byref(self.ropt),
                      byref(self.cam.pose), byref(self.con))
Example #4
0
 def render(self):
     rect = self.get_rect()
     arr = (ctypes.c_double * 3)(0, 0, 0)
     mjlib.mjv_makeGeoms(
         self.model.ptr, self.data.ptr, byref(self.objects),
         byref(self.vopt), mjCAT_ALL, 0, None, None,
         ctypes.cast(arr, ctypes.POINTER(ctypes.c_double)))
     mjlib.mjv_setCamera(self.model.ptr, self.data.ptr, byref(self.cam))
     mjlib.mjv_updateCameraPose(
         byref(self.cam), rect.width * 1.0 / rect.height)
     mjlib.mjr_render(0, rect, byref(self.objects), byref(
         self.ropt), byref(self.cam.pose), byref(self.con))