Cameras

Perspective Camera

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

Creates a Perspective Camera for visualization. The camera is inherited from VisualizationFrame,

It can be attached to dynamics objects, hence we can get a moving camera. All the transformation matrix generation methods are applicable to a Perspective Camera. Like VisualizationFrame, It can also be initialized using: 1)Rigidbody 2)ReferenceFrame, Point 3)ReferenceFrame, Particle Either one of these must be supplied during initialization

Unlike VisualizationFrame, It doesnt require a Shape argument.

Parameters:

name : str

a name for the PerspectiveCamera(optional). Default is ‘unnamed’ :

fov : int or float

Field Of View, It determines the angle between the top and bottom :

of the viewable area(in degrees). Default is 45 (degrees) :

near : int or float

The distance of near plane of the PerspectiveCamera. :

All objects closer to this distance are not displayed. :

far : int or float

The distance of far plane of the PerspectiveCamera :

All objects farther than this distance are not displayed. :

far[source]

attribute for Far Plane distance of a PerspectiveCamera Default is 1000

fov[source]

attribute for Field Of view of a PerspectiveCamera Default is 45 degrees

generate_visualization_dict()[source]

Returns a dictionary of all the info required for the visualization of this Camera

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

Returns:

a dictionary containing following keys: :

name : name of the PerspectiveCamera

fov : Field Of View of the PerspectiveCamera

simulation_matrix : a N*4*4 matrix, converted to list, for

passing to Javascript for animation purposes, where N is the :

number of timesteps for animations. :

near[source]

attribute for Near Plane distance of a PerspectiveCamera Default is 1

Orthographic Camera

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

Creates a OrthoGraphic Camera for visualization. The camera is inherited from VisualizationFrame,

It can be attached to dynamics objects, hence we can get a moving camera. All the transformation matrix generation methods are applicable to a Perspective Camera. Like VisualizationFrame, It can also be initialized using: 1)Rigidbody 2)ReferenceFrame, Point 3)ReferenceFrame, Particle Either one of these must be supplied during initialization

Unlike VisualizationFrame, It doesnt require a Shape argument.

Parameters:

name : str

a name for the PerspectiveCamera(optional). Default is ‘unnamed’ :

near : int or float

The distance of near plane of the PerspectiveCamera. :

All objects closer to this distance are not displayed. :

far : int or float

The distance of far plane of the PerspectiveCamera :

All objects farther than this distance are not displayed. :

far[source]

attribute for Far Plane distance of an OrthoGraphicCamera Default is 1000

generate_visualization_dict()[source]

Returns a dictionary of all the info required for the visualization of this Camera

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

Returns:

a dictionary containing following keys: :

name : name of the OrthoGraphicCamera

simulation_matrix : a N*4*4 matrix, converted to list, for

passing to Javascript for animation purposes, where N is the :

number of timesteps for animations. :

near[source]

attribute for Near Plane distance of an OrthoGraphicCamera Default is 1