MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / zoom

Method zoom

dm_control/viewer/viewer.py:426–435  ·  view source on GitHub ↗

Zooms the camera in/out. Args: zoom_factor: A floating point value, by how much to zoom the camera. Positive values zoom the camera in, negative values zoom it out.

(self, zoom_factor)

Source from the content-addressed store, hash-verified

424 self._camera.move(self._action.watermark, viewport_offset)
425
426 def zoom(self, zoom_factor):
427 """Zooms the camera in/out.
428
429 Args:
430 zoom_factor: A floating point value, by how much to zoom the camera.
431 Positive values zoom the camera in, negative values zoom it out.
432 """
433 if self._active:
434 offset = [0, _SCROLL_SPEED_FACTOR * zoom_factor * -1.]
435 self._camera.move(mujoco.mjtMouse.mjMOUSE_ZOOM, offset)
436
437 def track(self):
438 """Makes the camera track the currently selected object.

Calls 1

moveMethod · 0.80