Camera

class Camera[source]

Bases: object

Camera object for the default view.

Parameters
view: :class:`compas_view2.views.View`,

The parent view of the camera.

fov: float, optional

The field-of-view of the camera in degrees.

near: float, optional

Distance to the near clipping plane.

far: float, optional

Distance to the far clipping plane.

position: list[float], optional

The location the camera.

target: list[float], optional

The target location the camera is aimed at. Default is None, in which case the origin of the world coordinate system is used.

scale: float, optional

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

Notes

Under construction…

Attributes
fovfloat

The field of view as an angler in degrees.

nearfloat

The location of the “near” clipping plane.

farfloat

The locaiton of the “far” clipping plane.

positioncompas_view2.scene.camera.Position

The location the camera.

rotationcompas_view2.scene.camera.RotationEuler

The euler rotation of camera.

targetcompas_view2.scene.camera.Position

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

distancefloat

The distance from the camera standpoint to the target.

zoom_deltafloat

Size of one zoom increment.

rotation_deltafloat

Size of one rotation increment.

pan_deltafloat

Size of one pan increment.

scalefloat

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

Methods

look_at

Set the target of the camera, while keeping the current position.

pan

Pan the camera based on current mouse movement.

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.

zoom_extents