vgl.camera (class)

class vgl.camera()

Create a new instance of class camera

Returns:
rtype:vgl.camera
vgl.camera.viewAngle()

Get view angle of the camera

vgl.camera.setViewAngleDegrees(a)
Arguments:
  • a

Set view angle of the camera in degrees, which is converted to radians.

vgl.camera.setViewAngle(a)
Arguments:
  • a

Set view angle of the camera in degrees, which is converted to radians.

vgl.camera.position()

Get position of the camera

vgl.camera.setPosition(x, y, z)
Arguments:
  • x
  • y
  • z

Set position of the camera

vgl.camera.focalPoint()

Get focal point of the camera

vgl.camera.setFocalPoint(x, y, z)
Arguments:
  • x
  • y
  • z

Set focal point of the camera

vgl.camera.viewUpDirection()

Get view-up direction of camera

vgl.camera.setViewUpDirection(x, y, z)
Arguments:
  • x
  • y
  • z

Set view-up direction of the camera

vgl.camera.centerOfRotation()

Get center of rotation for camera

vgl.camera.setCenterOfRotation(centerOfRotation)
Arguments:
  • centerOfRotation

Set center of rotation for camera

vgl.camera.getClippingRange()

Get clipping range of the camera

vgl.camera.setClippingRange(near, far)
Arguments:
  • near
  • far

Set clipping range of the camera

vgl.camera.viewAspect()

Get view aspect

vgl.camera.setViewAspect(aspect)
Arguments:
  • aspect

Set view aspect

vgl.camera.isEnabledParallelProjection()

Return if parallel projection is enabled

vgl.camera.enableParallelProjection(flag)
Arguments:
  • flag

Enable / disable parallel projection

vgl.camera.setParallelProjection(left, right, top, bottom)
Arguments:
  • left
  • right
  • top
  • bottom

Set parallel projection parameters

vgl.camera.directionOfProjection()

Return direction of projection

vgl.camera.viewPlaneNormal()

Return view plane normal direction

vgl.camera.viewMatrix()

Return view-matrix for the camera This method does not compute the view-matrix for the camera. It is assumed that a call to computeViewMatrix has been made earlier.

Returns:
Return type:mat4
vgl.camera.projectionMatrix()

Return camera projection matrix This method does not compute the projection-matrix for the camera. It is assumed that a call to computeProjectionMatrix has been made earlier.

Returns:
Return type:mat4
vgl.camera.clearMask()

Return clear mask used by this camera

Returns:
Return type:number
vgl.camera.setClearMask(mask)
Arguments:
  • mask

Set clear mask for camera

vgl.camera.clearColor()

Get clear color (background color) of the camera

Returns:
Return type:Array
vgl.camera.setClearColor(color, g, b, a)
Arguments:
  • color – RGBA
  • g
  • b
  • a

Set clear color (background color) for the camera

vgl.camera.clearDepth()
Returns:
Return type:{1.0: null}
vgl.camera.setClearDepth(depth)
Arguments:
  • depth
vgl.camera.computeDirectionOfProjection()

Compute direction of projection

vgl.camera.computeViewPlaneNormal()

Compute view plane normal

vgl.camera.zoom(d)
Arguments:
  • d

Move camera closer or further away from the scene

vgl.camera.pan(dx, dy, dz)
Arguments:
  • dx
  • dy
  • dz

Move camera sideways

vgl.camera.computeOrthogonalAxes()

Compute camera coordinate axes

vgl.camera.rotate(dx, dy)
Arguments:
  • dx – Rotation around vertical axis in degrees
  • dy – Rotation around horizontal axis in degrees

Rotate camera around center of rotation

vgl.camera.computeViewMatrix()

Compute camera view matrix

vgl.camera.computeProjectionMatrix()

Compute camera projection matrix