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

Constructor

@:value({ maxAngleY : 40, minAngleY : -40, maxAngleX : 40, minAngleX : -40 })new(minAngleX:Float = -40, maxAngleX:Float = 40, minAngleY:Float = -40, maxAngleY:Float = 40)

Creates a new PerspectiveLens object.

Parameters:

fieldOfView

The vertical field of view of the projection.

Variables

maxAngleX:Float

maxAngleY:Float

minAngleX:Float

minAngleY:Float

Methods

@:value({ v : null })unproject(nX:Float, nY:Float, sZ:Float, ?v:Vector3D):Vector3D

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

Parameters:

nX

The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right.

nY

The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom.

sZ

The z coordinate in screen space, representing the distance into the screen.

v

The destination Vector3D object

Returns:

The scene position relative to the camera of the given screen coordinates.

Inherited Variables

Defined by LensBase

far:Float

frustumCorners:Vector<Float>

matrix:Matrix3D

near:Float

read onlyunprojectionMatrix:Matrix3D

Inherited Methods

Defined by LensBase

@:value({ v : null })project(point3d:Vector3D, ?v:Vector3D):Vector3D

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

Parameters:

point3d

the position vector of the scene coordinates to be projected.

v

The destination Vector3D object

Returns:

The normalised screen position of the given scene coordinates relative to the camera.