Cameras

Perspective Camera

class pydy.viz.camera.PerspectiveCamera(*args, **kwargs)[source]

Creates a perspective camera for use in a scene. The camera is inherited from VisualizationFrame, and thus behaves similarly. It can be attached to dynamics objects, hence we can get a moving camera. All the transformation matrix generation methods are applicable to a PerspectiveCamera.

generate_scene_dict(**kwargs)[source]

This method generates information for a static visualization in the initial conditions, in the form of dictionary. This contains camera parameters followed by an init_orientation key.

Before calling this method, all the transformation matrix generation methods should be called, or it will give an error.

Returns
A dict with following Keys:
  1. name: name for the camera
  2. fov: Field of View value of the camera
  3. near: near value of the camera
  4. far: far value of the camera
  5. init_orientation: Initial orientation of the camera

Orthographic Camera

class pydy.viz.camera.OrthoGraphicCamera(*args, **kwargs)[source]

Creates a orthographic camera for use in a scene. The camera is inherited from VisualizationFrame, and thus behaves similarly. It can be attached to dynamics objects, hence we can get a moving camera. All the transformation matrix generation methods are applicable to a OrthoGraphicCameraCamera.

generate_scene_dict(**kwargs)[source]

This method generates information for a static visualization in the initial conditions, in the form of dictionary. This contains camera parameters followed by an init_orientation Key.

Returns
scene_dictdictionary

A dict with following Keys:

  1. name: name for the camera

  2. near: near value of the camera

  3. far: far value of the camera

  4. init_orientation: Initial orientation of the camera