Packageaway3d.cameras.lenses
Classpublic class PerspectiveLens
InheritancePerspectiveLens Inheritance LensBase Inheritance flash.events.EventDispatcher

The PerspectiveLens object provides a projection matrix that projects 3D geometry with perspective distortion.



Public Properties
 PropertyDefined By
 Inheritedfar : Number
The distance to the far plane of the frustum.
LensBase
  fieldOfView : Number
The vertical field of view of the projection in degrees.
PerspectiveLens
  focalLength : Number
The focal length of the projection in units of viewport height.
PerspectiveLens
 InheritedfrustumCorners : Vector.<Number>
Retrieves the corner points of the lens frustum.
LensBase
 Inheritedmatrix : Matrix3D
The projection matrix that transforms 3D geometry to normalized homogeneous coordinates.
LensBase
 Inheritednear : Number
The distance to the near plane of the frustum.
LensBase
 InheritedunprojectionMatrix : Matrix3D
[read-only]
LensBase
Protected Properties
 PropertyDefined By
 Inherited_aspectRatio : Number = 1
LensBase
 Inherited_far : Number = 3000
LensBase
 Inherited_frustumCorners : Vector.<Number>
LensBase
 Inherited_matrix : Matrix3D
LensBase
 Inherited_matrixInvalid : Boolean = true
LensBase
 Inherited_near : Number = 20
LensBase
 Inherited_scissorRect : Rectangle
LensBase
 Inherited_viewPort : Rectangle
LensBase
Public Methods
 MethodDefined By
  
PerspectiveLens(fieldOfView:Number = 60)
Creates a new PerspectiveLens object.
PerspectiveLens
  
[override]
PerspectiveLens
 Inherited
project(point3d:Vector3D):Vector3D
Calculates the normalised position in screen space of the given scene position relative to the camera.
LensBase
  
unproject(nX:Number, nY:Number, sZ:Number):Vector3D
[override] Calculates the scene position relative to the camera of the given normalized coordinates in screen space.
PerspectiveLens
Protected Methods
 MethodDefined By
 Inherited
Invalidates the projection matrix, which will cause it to be updated on the next request.
LensBase
  
[override] Updates the matrix
PerspectiveLens
Property Detail
fieldOfViewproperty
fieldOfView:Number

The vertical field of view of the projection in degrees.


Implementation
    public function get fieldOfView():Number
    public function set fieldOfView(value:Number):void
focalLengthproperty 
focalLength:Number

The focal length of the projection in units of viewport height.


Implementation
    public function get focalLength():Number
    public function set focalLength(value:Number):void
Constructor Detail
PerspectiveLens()Constructor
public function PerspectiveLens(fieldOfView:Number = 60)

Creates a new PerspectiveLens object.

Parameters
fieldOfView:Number (default = 60) — The vertical field of view of the projection.
Method Detail
clone()method
override public function clone():LensBase

Returns
LensBase
unproject()method 
override public function unproject(nX:Number, nY:Number, sZ:Number):Vector3D

Calculates the scene position relative to the camera of the given normalized coordinates in screen space.

Parameters

nX:Number — The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right.
 
nY:Number — The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom.
 
sZ:Number — The z coordinate in screen space, representing the distance into the screen.

Returns
Vector3D — The scene position relative to the camera of the given screen coordinates.
updateMatrix()method 
override protected function updateMatrix():void

Updates the matrix