Packageorg.papervision3d.core.proto
Classpublic class CameraObject3D
InheritanceCameraObject3D Inheritance DisplayObject3D Inheritance DisplayObjectContainer3D Inheritance flash.events.EventDispatcher
SubclassesCamera3D

The CameraObject3D class is the base class for all the cameras that can be placed in a scene.

A camera defines the view from which a scene will be rendered. Different camera settings would present a scene from different points of view.

3D cameras simulate still-image, motion picture, or video cameras of the real world. When rendering, the scene is drawn as if you were looking through the camera lens.



Public Properties
 PropertyDefined by
 Inheritedalpha : Number = 1
DisplayObject3D
 InheritedautoCalcScreenCoords : Boolean
DisplayObject3D
 InheritedblendMode : String = "normal"
DisplayObject3D
 Inheritedchildren : Object
Returns the children object.
DisplayObjectContainer3D
 Inheritedcontainer : ViewportLayer
DisplayObject3D
 Inheritedculled : Boolean
[internal use] Is this object culled by camera frustum?
DisplayObject3D
  culler : IObjectCuller
CameraObject3D
 InheritedcullTest : Number = 0
DisplayObject3D
  DEFAULT_POS : Number3D
[static] The default position for new cameras.
CameraObject3D
  DEFAULT_UP : Number3D
[static] The default UP vector for new cameras.
CameraObject3D
  DEFAULT_VIEWPORT : Rectangle
[static] The default viewport for new cameras.
CameraObject3D
 Inheritedextra : Object
An object that contains user defined properties.
DisplayObject3D
  eye : Matrix3D
CameraObject3D
 InheritedfaceLevelMode : Boolean
[static] This allows objects faces to have their own containers.
DisplayObject3D
 Inheritedfaces : Array
[internal-use]
DisplayObject3D
  far : Number
Gets the distance to the far plane.
CameraObject3D
 Inheritedfilters : Array
DisplayObject3D
 InheritedflipLightDirection : Boolean = false
DisplayObject3D
  focus : Number
This value is a positive number representing the distance of the observer from the front clipping plane, which is the closest any object can be to the camera.
CameraObject3D
  fov : Number
Gets the vertical Field Of View in degrees.
CameraObject3D
 InheritedfrustumTestMethod : int = 0
DisplayObject3D
 Inheritedgeometry : GeometryObject3D
The GeometryObject3D object that contains the 3D definition of this instance.
DisplayObject3D
 Inheritedid : int
[read-only] Unique id of this instance.
DisplayObject3D
 InheritedlocalRotationX : Number
DisplayObject3D
 InheritedlocalRotationY : Number
DisplayObject3D
 InheritedlocalRotationZ : Number
DisplayObject3D
 Inheritedmaterial : MaterialObject3D
DisplayObject3D
 Inheritedmaterials : MaterialsList
The list of materials for this instance.
DisplayObject3D
 InheritedmeshSort : uint = 1
tells Mesh3D's render() method to compare the measurement choice of the user for a triangle's sorting
DisplayObject3D
 Inheritedname : String
An optional object name.
DisplayObject3D
  near : Number
Gets the distance to the near plane (note that this simply is an alias for #focus).
CameraObject3D
 InheritednumChildren : int
Returns the number of children of this object.
DisplayObjectContainer3D
  ortho : Boolean
Whether the camera uses orthographic projection.
CameraObject3D
  orthoScale : Number
The scale of projection when in orthographic mode.
CameraObject3D
 Inheritedparent : DisplayObjectContainer3D
[read-only] Indicates the DisplayObjectContainer3D object that contains this display object.
DisplayObject3D
 InheritedparentContainer : DisplayObject3D
DisplayObject3D
 Inheritedposition : Number3D
A Number3D containing the current x, y, and z of the DisplayObject3D
DisplayObject3D
 Inheritedroot : DisplayObjectContainer3D
[read-only] [read-only] The scene, which is the top-most displayObjectContainer3D in the tree structure.
DisplayObjectContainer3D
 InheritedrotationX : Number
Specifies the rotation around the X axis from its original orientation.
DisplayObject3D
 InheritedrotationY : Number
Specifies the rotation around the Y axis from its original orientation.
DisplayObject3D
 InheritedrotationZ : Number
Specifies the rotation around the Z axis from its original orientation.
DisplayObject3D
 Inheritedscale : Number
Sets the 3D scale as applied from the registration point of the object.
DisplayObject3D
 InheritedscaleX : Number
Sets the scale along the local X axis as applied from the registration point of the object.
DisplayObject3D
 InheritedscaleY : Number
Sets the scale along the local Y axis as applied from the registration point of the object.
DisplayObject3D
 InheritedscaleZ : Number
Sets the scale along the local Z axis as applied from the registration point of the object.
DisplayObject3D
 Inheritedscene : SceneObject3D
DisplayObject3D
 InheritedsceneX : Number
The X coordinate of a object relative to the scene coordinate system.
DisplayObject3D
 InheritedsceneY : Number
The Y coordinate of a object relative to the scene coordinate system.
DisplayObject3D
 InheritedsceneZ : Number
The Z coordinate of a object relative to the scene coordinate system.
DisplayObject3D
 Inheritedscreen : Number3D
[read-only] The coordinate of the object on screen.
DisplayObject3D
 InheritedscreenZ : Number
[internal-use] The average depth of the object faces center.
DisplayObject3D
  sort : Boolean
A Boolean value that determines whether the 3D objects are z-depth sorted between themselves when rendering.
CameraObject3D
 InheritedsortedArray : Array
[static]
DisplayObject3D
  target : DisplayObject3D
Gets the target for this camera, if any.
CameraObject3D
 InheritedtestQuad : Boolean = true
DisplayObject3D
 Inheritedtransform : Matrix3D
A Matrix3D object containing values that affect the scaling, rotation, and translation of the display object.
DisplayObject3D
 InheriteduseClipping : Boolean = true
DisplayObject3D
  useCulling : Boolean
Whether this camera uses culling.
CameraObject3D
 InheriteduseOwnContainer : Boolean
DisplayObject3D
  useProjectionMatrix : Boolean
Whether this camera uses a projection matrix.
CameraObject3D
 InheriteduserData : UserData
DisplayObject3D
 Inheritedview : Matrix3D
[internal-use] A camera transformed Matrix3D object.
DisplayObject3D
  viewport : Rectangle
CameraObject3D
 Inheritedvisible : Boolean
Whether or not the display object is visible.
DisplayObject3D
 Inheritedworld : Matrix3D
World transformation.
DisplayObject3D
 Inheritedx : Number
An Number that sets the X coordinate of a object relative to the origin of its parent.
DisplayObject3D
 Inheritedy : Number
An Number that sets the Y coordinate of a object relative to the origin of its parent.
DisplayObject3D
  yUP : Boolean
CameraObject3D
 Inheritedz : Number
An Number that sets the Z coordinate of a object relative to the origin of its parent.
DisplayObject3D
 InheritedZERO : DisplayObject3D
[static] Returns an empty DiplayObject3D object positioned in the center of the 3D coordinate system (0, 0 ,0).
DisplayObject3D
  zoom : Number
This value specifies the scale at which the 3D objects are rendered.
CameraObject3D
Protected Properties
 PropertyDefined by
 Inherited_children : Dictionary
[internal-use] Names indexed by children.
DisplayObjectContainer3D
 Inherited_childrenByName : Object
[internal-use] Children indexed by name.
DisplayObjectContainer3D
  _far : Number
CameraObject3D
  _ortho : Boolean
CameraObject3D
  _orthoScale : Number = 1
CameraObject3D
  _orthoScaleMatrix : Matrix3D
CameraObject3D
 Inherited_scene : SceneObject3D = null
The scene where the object belongs.
DisplayObject3D
 Inherited_sorted : Array
DisplayObject3D
  _target : DisplayObject3D
CameraObject3D
 Inherited_transformDirty : Boolean = false
[internal-use]
DisplayObject3D
  _useCulling : Boolean
CameraObject3D
 Inherited_useOwnContainer : Boolean = false
DisplayObject3D
  _useProjectionMatrix : Boolean
CameraObject3D
 Inherited_userData : UserData
DisplayObject3D
Public Methods
 MethodDefined by
  
CameraObject3D(focus:Number = 500, zoom:Number = 3)
The CameraObject3D constructor lets you create cameras for setting up the view from which a scene will be rendered.
CameraObject3D
 Inherited
addChild(child:DisplayObject3D, name:String = null):DisplayObject3D
Adds a child DisplayObject3D instance to this DisplayObjectContainer instance.
DisplayObject3D
 Inherited
Adds all the children of a DisplayObject3D instance to this DisplayObjectContainer instance.
DisplayObjectContainer3D
 Inherited
DisplayObject3D
 Inherited
addGeometry(geometry:GeometryObject3D = null):void
Adds a geometry definition to the instance.
DisplayObject3D
 Inherited
DisplayObject3D
 Inherited
childrenList():String
Returns a string value with the list of objects.
DisplayObjectContainer3D
 Inherited
Clones this object.
DisplayObject3D
 Inherited
copyPosition(reference:*):void
Copies the position information (x, y and z coordinates) from another object or Matrix3D.
DisplayObject3D
 Inherited
copyTransform(reference:*):void
Copies the transformation information (position, rotation and scale) from another object or Matrix3D.
DisplayObject3D
 Inherited
createViewportLayer(viewport:Viewport3D, recurse:Boolean = true):ViewportLayer
DisplayObject3D
 Inherited
Gets the distance to the position of the given object.
DisplayObject3D
 Inherited
getChildByName(name:String, recursive:Boolean = false):DisplayObject3D
Returns the child display object that exists with the specified name.
DisplayObjectContainer3D
 Inherited
Returns the material that exists with the specified name in the materials list.
DisplayObject3D
 Inherited
hitTestObject(obj:DisplayObject3D, multiplier:Number = 1):Boolean
Evaluates the display object to see if it overlaps or intersects with the obj display object.
DisplayObject3D
 Inherited
hitTestPoint(x:Number, y:Number, z:Number):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x, y and z parameters.
DisplayObject3D
  
lookAt(targetObject:DisplayObject3D, upAxis:Number3D = null):void
Lookat.
CameraObject3D
 Inherited
materialsList():String
Returns a string value with the list of material names of the materials list.
DisplayObject3D
 Inherited
moveBackward(distance:Number):void
Translate the display object in the opposite direction it is facing, i.e.
DisplayObject3D
 Inherited
moveDown(distance:Number):void
Translate the display object downwards, with respect to the direction it is facing, i.e.
DisplayObject3D
 Inherited
moveForward(distance:Number):void
Translate the display object in the direction it is facing, i.e.
DisplayObject3D
 Inherited
moveLeft(distance:Number):void
Translate the display object lateraly, to the left of the direction it is facing, i.e.
DisplayObject3D
 Inherited
moveRight(distance:Number):void
Translate the display object lateraly, to the right of the direction it is facing, i.e.
DisplayObject3D
 Inherited
moveUp(distance:Number):void
Translate the display object upwards, with respect to the direction it is facing, i.e.
DisplayObject3D
  
orbit(pitch:Number, yaw:Number, useDegrees:Boolean = true, target:DisplayObject3D = null):void
Orbits the camera around the specified target.
CameraObject3D
  
pan(angle:Number):void
Rotate the camera in its horizontal plane.
CameraObject3D
 Inherited
pitch(angle:Number):void
Rotate the display object around its lateral or transverse axis —an axis running from the pilot's left to right in piloted aircraft, and parallel to the wings of a winged aircraft; thus the nose pitches up and the tail down, or vice-versa.
DisplayObject3D
 Inherited
project(parent:DisplayObject3D, renderSessionData:RenderSessionData):Number
[internal-use] Projects three dimensional coordinates onto a two dimensional plane to simulate the relationship of the camera to subject.
DisplayObject3D
  
projectFaces(faces:Array, object:DisplayObject3D, renderSessionData:RenderSessionData):Number
CameraObject3D
  
projectVertices(vertices:Array, object:DisplayObject3D, renderSessionData:RenderSessionData):Number
Projects vertices.
CameraObject3D
 Inherited
Removes the specified child DisplayObject3D instance from the child list of the DisplayObjectContainer3D instance.
DisplayObjectContainer3D
 Inherited
Removes the child DisplayObject3D instance that exists with the specified name, from the child list of the DisplayObjectContainer3D instance.
DisplayObjectContainer3D
 Inherited
replaceMaterialByName(material:MaterialObject3D, name:String):void
Replaces a material by its name.
DisplayObject3D
 Inherited
roll(angle:Number):void
Rotate the display object around the longitudinal axis —an axis drawn through the body of the vehicle from tail to nose in the normal direction of flight, or the direction the object is facing.
DisplayObject3D
 Inherited
setChildMaterial(child:DisplayObject3D, material:MaterialObject3D, existingMaterial:MaterialObject3D = null):void
Sets the material for a child DisplayObject3D.
DisplayObject3D
 Inherited
setChildMaterialByName(childName:String, material:MaterialObject3D):void
Sets the material for a child DisplayObject3D by the child's name.
DisplayObject3D
  
tilt(angle:Number):void
Rotate the camera in its vertical plane.
CameraObject3D
 Inherited
toString():String
Returns a string value representing the three-dimensional position values of the display object instance.
DisplayObject3D
  
transformView(transform:Matrix3D = null):void
[internal-use] Transforms world coordinates into camera space.
CameraObject3D
 Inherited
translate(distance:Number, axis:Number3D):void
Move the object along a given direction.
DisplayObject3D
  
unproject(mX:Number, mY:Number):Number3D
Unproject.
CameraObject3D
 Inherited
[internal-use] Updates the transform Matrix3D with the current rotation and scale values.
DisplayObject3D
 Inherited
yaw(angle:Number):void
Rotate the display object around about the vertical axis —an axis drawn from top to bottom.
DisplayObject3D
Protected Methods
 MethodDefined by
 Inherited
setParentContainer(parent:DisplayObject3D, assign:Boolean = true):void
DisplayObject3D
Public Constants
 ConstantDefined by
 InheritedMESH_SORT_CENTER : uint = 1
[static] tells Mesh3D's render() method to sort by measuring from the center of a triangle
DisplayObject3D
 InheritedMESH_SORT_CLOSE : uint = 3
[static] tells Mesh3D's render() method to sort by measuring from the closest point of a triangle
DisplayObject3D
 InheritedMESH_SORT_FAR : uint = 2
[static] tells Mesh3D's render() method to sort by measuring from the farthest point of a triangle
DisplayObject3D
Property detail
cullerproperty
public var culler:IObjectCuller

DEFAULT_POSproperty 
public static var DEFAULT_POS:Number3D

The default position for new cameras.

DEFAULT_UPproperty 
public static var DEFAULT_UP:Number3D

The default UP vector for new cameras.

DEFAULT_VIEWPORTproperty 
public static var DEFAULT_VIEWPORT:Rectangle

The default viewport for new cameras.

eyeproperty 
public var eye:Matrix3D

_farproperty 
protected var _far:Number
farproperty 
far:Number  [read-write]

Gets the distance to the far plane.

Implementation
    public function get far():Number
    public function set far(value:Number):void
focusproperty 
public var focus:Number

This value is a positive number representing the distance of the observer from the front clipping plane, which is the closest any object can be to the camera. Use it in conjunction with zoom.

Higher focus values tend to magnify distance between objects while allowing greater depth of field, as if the camera had a wider lenses. One result of using a wide angle lens in proximity to the subject is an apparent perspective distortion: parallel lines may appear to converge and with a fisheye lens, straight edges will appear to bend.

Different lenses generally require a different camera to subject distance to preserve the size of a subject. Changing the angle of view can indirectly distort perspective, modifying the apparent relative size of the subject and foreground.

fovproperty 
fov:Number  [read-write]

Gets the vertical Field Of View in degrees.

Implementation
    public function get fov():Number
    public function set fov(value:Number):void
nearproperty 
near:Number  [read-write]

Gets the distance to the near plane (note that this simply is an alias for #focus).

Implementation
    public function get near():Number
    public function set near(value:Number):void
_orthoproperty 
protected var _ortho:Boolean
orthoproperty 
ortho:Boolean  [read-write]

Whether the camera uses orthographic projection.

Implementation
    public function get ortho():Boolean
    public function set ortho(value:Boolean):void
_orthoScaleproperty 
protected var _orthoScale:Number = 1
orthoScaleproperty 
orthoScale:Number  [read-write]

The scale of projection when in orthographic mode.

Implementation
    public function get orthoScale():Number
    public function set orthoScale(value:Number):void
_orthoScaleMatrixproperty 
protected var _orthoScaleMatrix:Matrix3D
sortproperty 
public var sort:Boolean

A Boolean value that determines whether the 3D objects are z-depth sorted between themselves when rendering.

_targetproperty 
protected var _target:DisplayObject3D
targetproperty 
target:DisplayObject3D  [read-write]

Gets the target for this camera, if any.

Implementation
    public function get target():DisplayObject3D
    public function set target(value:DisplayObject3D):void
_useCullingproperty 
protected var _useCulling:Boolean
useCullingproperty 
useCulling:Boolean  [read-write]

Whether this camera uses culling.

Implementation
    public function get useCulling():Boolean
    public function set useCulling(value:Boolean):void
_useProjectionMatrixproperty 
protected var _useProjectionMatrix:Boolean
useProjectionMatrixproperty 
useProjectionMatrix:Boolean  [read-write]

Whether this camera uses a projection matrix.

Implementation
    public function get useProjectionMatrix():Boolean
    public function set useProjectionMatrix(value:Boolean):void
viewportproperty 
public var viewport:Rectangle

yUPproperty 
public var yUP:Boolean

zoomproperty 
public var zoom:Number

This value specifies the scale at which the 3D objects are rendered. Higher values magnify the scene, compressing distance. Use it in conjunction with focus.

Constructor detail
CameraObject3D()constructor
public function CameraObject3D(focus:Number = 500, zoom:Number = 3)

The CameraObject3D constructor lets you create cameras for setting up the view from which a scene will be rendered.

Parameters
focus:Number (default = 500) — This value is a positive number representing the distance of the observer from the front clipping plane, which is the closest any object can be to the camera. Use it in conjunction with zoom.

 
zoom:Number (default = 3) — This value specifies the scale at which the 3D objects are rendered. Higher values magnify the scene, compressing distance. Use it in conjunction with focus.

Method detail
lookAt()method
public override function lookAt(targetObject:DisplayObject3D, upAxis:Number3D = null):void

Lookat.

Parameters
targetObject:DisplayObject3D
 
upAxis:Number3D (default = null)
orbit()method 
public function orbit(pitch:Number, yaw:Number, useDegrees:Boolean = true, target:DisplayObject3D = null):void

Orbits the camera around the specified target. If no target is specified the camera's #target property is used. If this camera's #target property equals null the camera orbits the origin (0, 0, 0).

Parameters
pitch:Number — Rotation around X=axis (looking up or down).
 
yaw:Number — Rotation around Y-axis (looking left or right).
 
useDegrees:Boolean (default = true) — Whether to use degrees for pitch and yaw (defaults to 'true').
 
target:DisplayObject3D (default = null) — An optional target to orbit around.
pan()method 
public function pan(angle:Number):void

Rotate the camera in its horizontal plane.

Panning the camera results in a motion similar to someone shaking their head "no".

Parameters
angle:Number — Angle to pan the camera.
projectFaces()method 
public function projectFaces(faces:Array, object:DisplayObject3D, renderSessionData:RenderSessionData):NumberParameters
faces:Array
 
object:DisplayObject3D
 
renderSessionData:RenderSessionData

Returns
Number
projectVertices()method 
public function projectVertices(vertices:Array, object:DisplayObject3D, renderSessionData:RenderSessionData):Number

Projects vertices.

Parameters
vertices:Array
 
object:DisplayObject3D
 
renderSessionData:RenderSessionData

Returns
Number
tilt()method 
public function tilt(angle:Number):void

Rotate the camera in its vertical plane.

Tilting the camera results in a motion similar to someone nodding their head "yes".

Parameters
angle:Number — Angle to tilt the camera.
transformView()method 
public function transformView(transform:Matrix3D = null):void

[internal-use] Transforms world coordinates into camera space.

Parameters
transform:Matrix3D (default = null)
unproject()method 
public function unproject(mX:Number, mY:Number):Number3D

Unproject.

Parameters
mX:Number
 
mY:Number

Returns
Number3D