Camera

class Camera[source]

Bases: object

Camera object for the default view.

Parameters:
renderercompas_viewer.components.renderer.Renderer,

The parent renderer of the camera.

Notes

The camera is defined by the following parameters which can be found in: compas_viewer.configurations.render_config.CameraConfig:

fovfloat

The field of view as an angler in degrees.

nearfloat

The location of the “near” clipping plane.

farfloat

The location of the “far” clipping plane.

positioncompas_viewer.components.renderer.camera.Position

The location the camera.

rotationcompas_viewer.components.renderer.camera.RotationEuler

The euler rotation of camera.

targetcompas_viewer.components.renderer.camera.Position

The viewing target. Default is the origin of the world coordinate system.

distancefloat

The distance from the camera standpoint to the target.

zoomdeltafloat

Size of one zoom increment.

rotationdeltafloat

Size of one rotation increment.

pan_deltafloat

Size of one pan increment.

scalefloat

The scale factor for camera’s near, far and pan_delta.

Attributes:
configcompas_viewer.configurations.render_config.CameraConfig

Methods

ortho

Construct an orthogonal projection matrix.

pan

Pan the camera based on current mouse movement.

perspective

Construct a perspective projection matrix.

projection

Compute the projection matrix corresponding to the current camera settings.

reset_position

Reset the position of the camera based current view type.

rotate

Rotate the camera based on current mouse movement.

viewworld

Compute the view-world matrix corresponding to the current camera settings.

zoom

Zoom in or out.