User Tools

Site Tools


DzCamera

Base class for all camera objects.

More...

Inherits :

Inherited By : DzBasicCamera and DzLight

Enumerations

Properties

Methods

Signals

Detailed Description

TODO: Add detailed description.

Enumerations


: CameraDimension

The dimensions of a camera.

Since:

  • 4.6.4.70
  • LOCAL_PIXEL_WIDTH - The width in pixels. Since: 4.6.4.70
  • LOCAL_PIXEL_HEIGHT - The height in pixels. Since: 4.6.4.70
  • LOCAL_ASPECT_WIDTH - The relative width of the aspect frame. Since: 4.6.4.70
  • LOCAL_ASPECT_HEIGHT - The relative height of the aspect frame. Since: 4.6.4.70

—–

: CameraType

The different types of camera. Each has its own default parameters which it resets to and are either orthogonal or perspective by definition.

  • FRONT_CAMERA - Orthogonal camera positioned to view the front of a figure
  • BACK_CAMERA - Orthogonal camera positioned to view the back of a figure
  • LEFT_CAMERA - Orthogonal camera positioned to view the left side of a figure.
  • RIGHT_CAMERA - Orthogonal camera positioned to view the right side of a figure.
  • TOP_CAMERA - Orthogonal camera positioned to view a figure from the top.
  • BOTTOM_CAMERA - Orthogonal camera positioned to view a figure from the bottom.
  • PERSPECTIVE_CAMERA - Default perspective camera - defaults to a front view of a figure.
  • ORTHO_CAMERA - General Orthogonal camera.
  • GENERAL_CAMERA - General Perspective camera.

—–

: HeadlightMode

The modes of the headlight for this camera.

Since:

  • 4.7.1.94
  • hmAuto - The headlight is automatically on or off depending on whether or not lights are in the scene. Since: 4.7.1.94
  • hmOn - The headlight is on. Since: 4.7.1.94
  • hmOff - The headlight is off. Since: 4.7.1.94

Properties


Number : aspectHeight

The aspect height of this camera.

Since:

  • 4.6.4.67

Number : aspectRatio

The aspect ratio of this camera (w / h).

Since:

  • 4.6.4.67

See Also:


Number : aspectWidth

The aspect width of this camera.

Since:

  • 4.6.4.67

Number : farClippingPlane

The distance of the far clipping plane from this camera. (Read Only)


Number : focalDistance

The focal distance of this camera.


Number : focalLength

The focal length of this camera.


Number : frameWidth

The width of the frame (film/sensor) of this camera (in mm). (Read Only)

Since:

  • 4.6.4.67

HeadlightMode : headlightMode

The mode of the headlight.

Since:

  • 4.7.1.94

DzVec3 : headlightOffset

The relative offset of the headlight from this camera.

Since:

  • 4.7.1.94

Number : nearClippingPlane

The distance of the near clipping plane from this camera. (Read Only)


Number : pixelsHeight

The pixels height of this camera.

Since:

  • 4.6.4.67

Number : pixelsWidth

The pixels width of this camera.

Since:

  • 4.6.4.67

Boolean : proportionsConstrained

Whether or not the proportions of this camera is constrained.

Since:

  • 4.6.4.70

Number : type

The type of this camera. (Read Only)


Boolean : useLocalDimensions

Whether or not to use the local dimensions of this camera.

Since:

  • 4.6.4.67

Methods


void : aimAt( DzVec3 pos )

Rotates this camera and adjusts its focal distance so that its focal point is at the given point.

Parameter(s):

  • pos - The point to aim this camera at.

void : frame( DzBox3 box, Number aspect )

Translates this camera so that its view frames the given box, and sets this camera's focal point to the center of the box, given the aspect ratio of the current view (w / h)

Parameter(s):

  • box - The bounding box to frame in this camera's view
  • aspect - The aspect ratio of the current view.

Number : getFieldOfView()

Return Value:

  • The angle, in radians, of the horizontal field of view (FOV) for this camera (rectilinear lens).

Attention:

  • The following formula is used to calculate the horizontal FOV:
angle = 2 * (arctan(frameWidth)/(2 * focalLength)))

The aspect of the frame can be manipulated by the user. Therefore, calculating the vertical and/or diagonal FOV is accomplished using the aspect ratio.

See Also:


DzVec3 : getFocalPoint()

Return Value:

  • The focal point of this camera.

DzLight : getHeadlight()

Return Value:

  • A light that illuminates the scene in front of this camera. Used for rendering by OpenGL and offline renderers when no lights exist in the scene. This headlight is created on demand - i.e. no headlight for this camera exists until this function is called the first time.

Boolean : isViewCamera()

Return Value:

  • true if this is a non-animatable view camera, otherwise false.

void : reset()

Resets this camera viewing parameters to defaults.


Boolean : shouldDoHeadLight( Boolean hasLights, Boolean isRender )

Parameter(s):

  • hasLights - Whether or not the scene has lights.
  • isRender - Whether or not the call is for the purpose of a render.

Return Value:

  • true if the headlight should contribute light to the scene, otherwise false.

Since:

  • 4.7.1.94

void : updateDimensions( CameraDimension anchor )

Updates the other dimensions given an anchor dimension.

Parameter(s):

  • anchor - The anchor dimension.

Signals


void : aspectHeightChanged( Number height )

Signature:“aspectHeightChanged(float)”

Emitted when the aspect height dimension of this camera changes.


void : aspectRatioChanged()

Signature:“aspectRatioChanged()”

Emitted when this camera's aspect ratio changes.


void : aspectWidthChanged( Number width )

Signature:“aspectWidthChanged(float)”

Emitted when the aspect width dimension of this camera changes.


void : dimensionsChanged()

Signature:“dimensionsChanged()”

Emitted when any of the local dimensions of this camera change.


void : focalDistanceChanged( DzTimeRange range )

Signature:“focalDistanceChanged(const DzTimeRange&)”

Emitted when the focal distance channel changes.

Parameter(s):

  • range - The time range over which the channel changed.

void : focalLengthChanged( DzTimeRange range )

Signature:“focalLengthChanged(const DzTimeRange&)”

Emitted when the focal length channel changes.

Parameter(s):

  • range - The time range over which the channel changed.

void : frameWidthChanged( Number size )

Signature:“frameWidthChanged(float)”

Emitted when the frame width of this camera changes.


void : headlightModeChanged()

Signature:“headlightModeChanged()”

Emitted when headlight mode of this camera changes.


void : headlightOffsetChanged()

Signature:“headlightOffsetChanged()”

Emitted when headlight offset of this camera changes.


void : pixelDimensionsChanged()

Signature:“pixelDimensionsChanged()”

Emitted when the local pixel dimensions of this camera change.


void : pixelsHeightChanged( Number height )

Signature:“pixelsHeightChanged(int)”

Emitted when the pixel height dimension of this camera changes.


void : pixelsWidthChanged( Number width )

Signature:“pixelsWidthChanged(int)”

Emitted when the pixel width dimension of this camera changes.


void : projectionChanged()

Signature:“projectionChanged()”

Emitted when projection of this camera changes and its view must be redrawn.


void : proportionsConstrainedChanged( Boolean yesNo )

Signature:“proportionsConstrainedChanged(bool)”

Emitted when the option for whether or not to constrain proportions of the local dimensions of this camera changes.


void : useLocalDimensionsChanged( Boolean yesNo )

Signature:“aspectRatioChanged(bool)”

Emitted when the option for whether or not to use the local dimensions of this camera changes.