Class Matrix3D
java.lang.Object
|
+----Matrix3D
- public class Matrix3D
- extends Object
Matrix3D Class
-
Matrix3D()
- blank constructor for future extentions
-
Matrix3D(Matrix3D)
- initialize with copy of source
-
Matrix3D(Raster)
- initialize with a mapping from
canonical space to screen space
-
compose(float[][])
-
-
compose(Matrix3D)
- this = this * src
compose two matricies -- they must be of the
same size and square.
-
crossprod(float[], float[])
-
-
dotprod(float[], float[])
-
-
get(int, int)
- This method returns element [j][i]
from this transformation matrix
-
initializeIdentity()
- initializes the identity matrix
which is 4x4 matrix kept as a private
variable in this class.
-
initializeShear(float, float, float)
- initializes the shear matrix used for skew procedure
-
loadIdentity()
- this = identity
loads identity matrix in as this matrix
-
lookAt(float, float, float, float, float, float, float, float, float)
- this = this * lookat
Natural Viewing Transform: Transform the eye to the origin
and the look-at direction (optical axis) to a specified
coordinate axis.
-
matAdd(float[][], float[][])
- adds two matricies together, entry by entry
and return resulting matrix.
-
multiplyConst(float[][], float)
-
-
multiplyPoint(Point3D)
- This method is used as a subroutine for public void transform
and will multiply this matrix with a column vector created
from the Point3D that is passed in as an argument.
-
normalizeVal(float[])
-
-
orthographic(float, float, float, float, float, float)
- this = this * ortho
Orthographic or parallel projection: Images lack perspective,
don't appear natural.
-
perspective(float, float, float, float, float, float)
- this = this * perps
Perspective Transformation: Causes objects nearer to
the viewer to appear larger than the same object would
appear farther away.
-
rotate(float, float, float, float)
- this = this*rotate
Expects angle in radians.
-
scale(float, float, float)
- this = this * scale
composes this matrix with scale matrix that
is defined by points sx, sy, sz
-
set(int, int, float)
- This method sets element [j][i] to value
in this transformation matrix
-
skew(float, float, float)
- this = this*skew
composes this matrix with a skew matrix
that is defined by points kxy, kxz, kyz
-
toString()
-
-
transform(Point3D[], Point3D[], int, int)
- Transforms points from the in array to the out array
using the current matrix.
-
translate(float, float, float)
-
this = this * t
multiply matrix = matrix*t where t is a column vector
Matrix3D
public Matrix3D()
- blank constructor for future extentions
Matrix3D
public Matrix3D(Matrix3D copy)
- initialize with copy of source
Matrix3D
public Matrix3D(Raster r)
- initialize with a mapping from
canonical space to screen space
set
public void set(int i,
int j,
float value)
- This method sets element [j][i] to value
in this transformation matrix
get
public float get(int i,
int j)
- This method returns element [j][i]
from this transformation matrix
transform
public void transform(Point3D in[],
Point3D out[],
int start,
int length)
- Transforms points from the in array to the out array
using the current matrix. The subset of points transformed
begins at the start index and has the specified length
for (i = 0; i < length; i++)
out[start+i] = this * in[start+i]
compose
public final void compose(Matrix3D src)
- this = this * src
compose two matricies -- they must be of the
same size and square. The matrix from the argument
is from an object of type Matrix3D.
compose
protected final void compose(float src[][])
loadIdentity
public void loadIdentity()
- this = identity
loads identity matrix in as this matrix
translate
public void translate(float tx,
float ty,
float tz)
- this = this * t
multiply matrix = matrix*t where t is a column vector
scale
public void scale(float sx,
float sy,
float sz)
- this = this * scale
composes this matrix with scale matrix that
is defined by points sx, sy, sz
skew
public void skew(float kxy,
float kxz,
float kyz)
- this = this*skew
composes this matrix with a skew matrix
that is defined by points kxy, kxz, kyz
rotate
public void rotate(float ax,
float ay,
float az,
float angle)
- this = this*rotate
Expects angle in radians. The axis of rotation is
determined by the values of ax, ay, and az.
lookAt
public void lookAt(float eyex,
float eyey,
float eyez,
float atx,
float aty,
float atz,
float upx,
float upy,
float upz)
- this = this * lookat
Natural Viewing Transform: Transform the eye to the origin
and the look-at direction (optical axis) to a specified
coordinate axis.
normalizeVal
protected float normalizeVal(float a[])
crossprod
protected float[] crossprod(float a[],
float b[])
dotprod
protected float dotprod(float a[],
float b[])
perspective
public void perspective(float left,
float right,
float bottom,
float top,
float near,
float far)
- this = this * perps
Perspective Transformation: Causes objects nearer to
the viewer to appear larger than the same object would
appear farther away. Parallel lines appear to converge to
a single point when viewed in perspective. (The artist's projection)
orthographic
public void orthographic(float left,
float right,
float bottom,
float top,
float near,
float far)
- this = this * ortho
Orthographic or parallel projection: Images lack perspective,
don't appear natural. parallel lines remain parallel.
toString
public String toString()
- Overrides:
- toString in class Object
multiplyPoint
protected Point3D multiplyPoint(Point3D p)
- This method is used as a subroutine for public void transform
and will multiply this matrix with a column vector created
from the Point3D that is passed in as an argument.
transpose([x',y',z',1]) = this.matrix*transpose([x,y,z,1])
initializeShear
protected void initializeShear(float kxy,
float kxz,
float kyz)
- initializes the shear matrix used for skew procedure
initializeIdentity
protected void initializeIdentity()
- initializes the identity matrix
which is 4x4 matrix kept as a private
variable in this class.
multiplyConst
protected float[][] multiplyConst(float a[][],
float ct)
matAdd
protected float[][] matAdd(float a[][],
float b[][])
- adds two matricies together, entry by entry
and return resulting matrix. Assumes matricies
are of the same size and are square.