Packagenet.bgstaal.perspectiveprojection
Classpublic class Point3d

Point3d ©2009, bgstaal.net
The Point3d holds the properties to represent a single point i 3d space (x,y,z) and the methods to apply transformation matrices and return a 2d representation of the 3d point.



Public Properties
 PropertyDefined by
  x : Number
The x coordinate
Point3d
  y : Number
The y coordinate
Point3d
  z : Number
The z coordinate
Point3d
Public Methods
 MethodDefined by
  
Point3d(x:Number = 0, y:Number = 0, z:Number = 0)
Creates a Point3d instance
Point3d
  
applyMatrix(m:Matrix3d, pivotPoint:Point3d = null):void
Applies the supplied transformation matrix to the point around the supplied pivot point
Point3d
  
project(focalLength:Number, projectionCenter:Point = null):Point2d
Performs a perspective projection on the instance and returns a 2d represenation of the 3d coordinates
Point3d
Property detail
xproperty
public var x:Number

The x coordinate

yproperty 
public var y:Number

The y coordinate

zproperty 
public var z:Number

The z coordinate

Constructor detail
Point3d()constructor
public function Point3d(x:Number = 0, y:Number = 0, z:Number = 0)

Creates a Point3d instance

Parameters
x:Number (default = 0) — The x coordinate
 
y:Number (default = 0) — The y coordinate
 
z:Number (default = 0) — The z coordinate
Method detail
applyMatrix()method
public function applyMatrix(m:Matrix3d, pivotPoint:Point3d = null):void

Applies the supplied transformation matrix to the point around the supplied pivot point

Parameters
m:Matrix3d — m Matrix3d instance with the transformation values
 
pivotPoint:Point3d (default = null) — pivotPoint A Point in 3d witch the transformation should be applied around. The coordinates (0,0,0) is used if no value is supplied.
project()method 
public function project(focalLength:Number, projectionCenter:Point = null):Point2d

Performs a perspective projection on the instance and returns a 2d represenation of the 3d coordinates

Parameters
focalLength:Number — focalLength Distance from camera to the stage
 
projectionCenter:Point (default = null) — projectionCenter 2d coordinate representing the center of the viewing frustrum (vanishing point)

Returns
Point2d — A Point2d instance representing a projected version of this