Packagenet.bgstaal.perspectiveprojection
Classpublic class Matrix3d

Matrix3d ©2009, bgstaal.net
The Matrix3d class let's you create 4x3 rotation matrices wich can be applied to Point3d instances.



Public Properties
 PropertyDefined by
  n11 : Number

X 0 0 0
0 0 0 0
0 0 0 0

Matrix3d
  n12 : Number

0 X 0 0
0 0 0 0
0 0 0 0

Matrix3d
  n13 : Number

0 0 X 0
0 0 0 0
0 0 0 0

Matrix3d
  n14 : Number

0 0 0 X
0 0 0 0
0 0 0 0

Matrix3d
  n21 : Number

0 0 0 0
X 0 0 0
0 0 0 0

Matrix3d
  n22 : Number

0 0 0 0
0 X 0 0
0 0 0 0

Matrix3d
  n23 : Number

0 0 0 0
0 0 X 0
0 0 0 0

Matrix3d
  n24 : Number

0 0 0 0
0 0 0 X
0 0 0 0

Matrix3d
  n31 : Number

0 0 0 0
0 0 0 0
X 0 0 0

Matrix3d
  n32 : Number

0 0 0 0
0 0 0 0
0 X 0 0

Matrix3d
  n33 : Number

0 0 0 0
0 0 0 0
0 0 X 0

Matrix3d
  n34 : Number

0 0 0 0
0 0 0 0
0 0 0 X

Matrix3d
Public Methods
 MethodDefined by
  
Matrix3d(n11:Number = 1, n12:Number = 0, n13:Number = 0, n14:Number = 0, n21:Number = 0, n22:Number = 1, n23:Number = 0, n24:Number = 0, n31:Number = 0, n32:Number = 0, n33:Number = 1, n34:Number = 0)
Create a new Matrix3d Object.
Matrix3d
  
apply(p:Point3d, pivotPoint:Point3d = null):Point3d
Applies the transformation to a Point3d around a pivot point and returns a new point3d
Matrix3d
  
createRotationMatrix(xRotation:Number, yRotation:Number, zRotation:Number):Matrix3d
[static] Creates a transformation matrix with the supplied rotation around either axis
Matrix3d
  
createXRotationMatrix(rotation:Number):Matrix3d
[static] Creates a rotation matrix with the supplied rotation around the x axis.
Matrix3d
  
createYRotationMatrix(rotation:Number):Matrix3d
[static] Creates a rotation matrix with the supplied rotation around the y axis.
Matrix3d
  
createZRotationMatrix(rotation:Number):Matrix3d
[static] Creates a rotation matrix with the supplied rotation around the z axis.
Matrix3d
  
[static] Creates a Matrix3d filled with the values from the supplied array
Matrix3d
  
[static] Multiplies two Matrix3d instances and returns the result
Matrix3d
  
multiplySeveral(... matrices):Matrix3d
[static] Multiplies several Matrix3d instances and returns the result
Matrix3d
Property detail
n11property
public var n11:Number

X 0 0 0
0 0 0 0
0 0 0 0

n12property 
public var n12:Number

0 X 0 0
0 0 0 0
0 0 0 0

n13property 
public var n13:Number

0 0 X 0
0 0 0 0
0 0 0 0

n14property 
public var n14:Number

0 0 0 X
0 0 0 0
0 0 0 0

n21property 
public var n21:Number

0 0 0 0
X 0 0 0
0 0 0 0

n22property 
public var n22:Number

0 0 0 0
0 X 0 0
0 0 0 0

n23property 
public var n23:Number

0 0 0 0
0 0 X 0
0 0 0 0

n24property 
public var n24:Number

0 0 0 0
0 0 0 X
0 0 0 0

n31property 
public var n31:Number

0 0 0 0
0 0 0 0
X 0 0 0

n32property 
public var n32:Number

0 0 0 0
0 0 0 0
0 X 0 0

n33property 
public var n33:Number

0 0 0 0
0 0 0 0
0 0 X 0

n34property 
public var n34:Number

0 0 0 0
0 0 0 0
0 0 0 X

Constructor detail
Matrix3d()constructor
public function Matrix3d(n11:Number = 1, n12:Number = 0, n13:Number = 0, n14:Number = 0, n21:Number = 0, n22:Number = 1, n23:Number = 0, n24:Number = 0, n31:Number = 0, n32:Number = 0, n33:Number = 1, n34:Number = 0)

Create a new Matrix3d Object. By default a 4x3 identity matrix is created.

Parameters
n11:Number (default = 1) — The value in the first collumn of the first row
 
n12:Number (default = 0) — The value in the second collumn of the first row
 
n13:Number (default = 0) — The value in the third collumn of the first row
 
n14:Number (default = 0) — The value in the fourth collumn of the first row
 
n21:Number (default = 0) — The value in the first collumn of the second row
 
n22:Number (default = 1) — The value in the second collumn of the second row
 
n23:Number (default = 0) — The value in the third collumn of the second row
 
n24:Number (default = 0) — The value in the fourth collumn of the second row
 
n31:Number (default = 0) — The value in the first collumn of the third row
 
n32:Number (default = 0) — The value in the second collumn of the third row
 
n33:Number (default = 1) — The value in the third collumn of the third row
 
n34:Number (default = 0) — The value in the fourth collumn of the third row
Method detail
apply()method
public function apply(p:Point3d, pivotPoint:Point3d = null):Point3d

Applies the transformation to a Point3d around a pivot point and returns a new point3d

Parameters
p:Point3d — The point witch the transformation should be applied to.
 
pivotPoint:Point3d (default = null) — The point in 3d witch the transformation should be applied around. The coordinates (0,0,0) is used if no value is supplied.

Returns
Point3d — A new Point3d representing the supplied Point3d instance with the transformations applied.
createRotationMatrix()method 
public static function createRotationMatrix(xRotation:Number, yRotation:Number, zRotation:Number):Matrix3d

Creates a transformation matrix with the supplied rotation around either axis

Parameters
xRotation:Number — The number of degrees of rotation that should be applied around the x axis. (roll)
 
yRotation:Number — The number of degrees of rotation that should be applied around the y axis. (pitch)
 
zRotation:Number — The number of degrees of rotation that should be applied around the z axis. (yaw)

Returns
Matrix3d — A Matrix3d instance with the supplied rotations applied.
createXRotationMatrix()method 
public static function createXRotationMatrix(rotation:Number):Matrix3d

Creates a rotation matrix with the supplied rotation around the x axis. (roll)

Parameters
rotation:Number — The number of degrees of rotation that should be applied around the x axis

Returns
Matrix3d — A Matrix3d instance with the supplied x rotation applied.
createYRotationMatrix()method 
public static function createYRotationMatrix(rotation:Number):Matrix3d

Creates a rotation matrix with the supplied rotation around the y axis. (pitch)

Parameters
rotation:Number — The number of degrees of rotation that should be applied around the y axis

Returns
Matrix3d — A Matrix3d instance with the supplied y rotation applied.
createZRotationMatrix()method 
public static function createZRotationMatrix(rotation:Number):Matrix3d

Creates a rotation matrix with the supplied rotation around the z axis. (yaw)

Parameters
rotation:Number — The number of degrees of rotation that should be applied around the z axis

Returns
Matrix3d — A Matrix3d instance with the supplied z rotation applied.
matrix3dFromArray()method 
public static function matrix3dFromArray(n:Array):Matrix3d

Creates a Matrix3d filled with the values from the supplied array

Parameters
n:Array — A Array instance with 12 entries representing the numbers in the matrix starting with the top left collumn and ending with the bottom right.

Returns
Matrix3d — A Matrix3d instance filled with the supplied values
multiply()method 
public static function multiply(a:Matrix3d, b:Matrix3d):Matrix3d

Multiplies two Matrix3d instances and returns the result

Parameters
a:Matrix3d — The first matrix
 
b:Matrix3d — The seconds matrix

Returns
Matrix3d — A Matrix3d instance representing the result of the multiplication
multiplySeveral()method 
public static function multiplySeveral(... matrices):Matrix3d

Multiplies several Matrix3d instances and returns the result

Parameters
... matrices — The Matrix3d instances that should be multiplied.

Returns
Matrix3d — A Matrix3d instance representing the result of the multiplication