A Camera3D object represents a virtual camera through which we view the scene.


Inherited from Entity -> ObjectContainer3D -> Object3D -> NamedAssetBase -> EventDispatcher.


Can be created using method new:

Lib.Away3D.Cameras.Camers3D.new(lens)

Creates a new Camera3D object

lens - (default = nil) - An optional lens object that will perform the projection. Defaults to PerspectiveLens. (LensBase)


Created Cemera3D object has properties:

assetType

[override] [read-only] String

frustumPlanes

[read-only] Vector array of (Plane3D)

lens

The lens used by the camera to perform the projection (LensBase)

viewProjection

[read-only] The view projection matrix of the camera. (Matrix3D)


methods:

getRay(nX, nY, sZ)

Calculates the ray in scene space from the camera to the given normalized coordinates in screen space. (Vector3D)

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

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

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

project(point3d)

Calculates the normalised position in screen space of the given scene position. (Vector3D)

point3d - the position vector of the scene coordinates to be projected. (Vector3D)

unproject(nX, nY, sZ)

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

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

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

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


Created with the Personal Edition of HelpNDoc: Free help authoring environment