|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.motorola.iden.micro3d.AffineTransform
3D affine transformation class. This class handles the 3D affine transformation matrix. Element values are expressed as a fixed-point integer where 4096 is equal to 1.00. All values in the matrix must be in the range -32768 to 32767. Values that are smaller than -32768 will be automatically adjusted to -32768. Similarly, values greater than 32767 will be automatically adjusted to 32767.
Field Summary | |
static int |
M00
Specifies matrix element at row 1, column 1. |
static int |
M01
Specifies matrix element at row 1, column 2. |
static int |
M02
Specifies matrix element at row 1, column 3. |
static int |
M03
Specifies matrix element at row 1, column 4. |
static int |
M10
Specifies matrix element at row 2, column 1. |
static int |
M11
Specifies matrix element at row 2, column 2. |
static int |
M12
Specifies matrix element at row 2, column 3. |
static int |
M13
Specifies matrix element at row 2, column 4. |
static int |
M20
Specifies matrix element at row 3, column 1. |
static int |
M21
Specifies matrix element at row 3, column 2. |
static int |
M22
Specifies matrix element at row 3, column 3. |
static int |
M23
Specifies matrix element at row 3, column 4. |
static int |
MAX_VALUE
The maximum value that can be used by the AffineTransform . |
static int |
MIN_VALUE
The minimum value that can be used by the AffineTransform . |
Constructor Summary | |
AffineTransform()
Constructs an AffineTransform with all of its elements set to 0. |
|
AffineTransform(int[][] elements)
Constructs an AffineTransform with its elements set to the
values in the specified two-dimensional array. |
Method Summary | |
int |
get(int fieldID)
Gets the specified AffineTransform matrix element value.
|
static AffineTransform |
getViewPointTransform(Vector3D position,
Vector3D look,
Vector3D up)
Calculates a view point transformation matrix. |
void |
multiply(AffineTransform multiplier)
Multiplies this AffineTransform object against another.
|
static AffineTransform |
multiply(AffineTransform multiplicand,
AffineTransform multiplier)
Multiplies two AffineTransform objects against another.
|
static void |
multiply(AffineTransform destination,
AffineTransform multiplicand,
AffineTransform multiplier)
Multiplies two AffineTransform objects and stores the result
of the operation in the specified destination.
|
void |
normalize()
Normalizes this AffineTransform .
|
void |
rotateV(Vector3D axis,
int angle)
Rotates this transform about an arbitrary unit vector. |
void |
rotateX(int angle)
Rotates this transform about the x-axis. |
void |
rotateY(int angle)
Rotates this transform about the y-axis. |
void |
rotateZ(int angle)
Rotates this transform about the z-axis. |
void |
set(int[][] elements)
Sets the AffineTransform matrix elements with the integers in
the specified two-dimensional array. |
void |
set(int fieldID,
int value)
Sets the specified AffineTransform matrix element with the specified value.
|
void |
setIdentity()
Converts this AffineTransform to an identity matrix. |
Vector3D |
transformPoint(Vector3D source)
Returns a Vector3D transformed from a given point in this AffineTransform .
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int M00
public static final int M01
public static final int M02
public static final int M03
public static final int M10
public static final int M11
public static final int M12
public static final int M13
public static final int M20
public static final int M21
public static final int M22
public static final int M23
public static final int MIN_VALUE
AffineTransform
.public static final int MAX_VALUE
AffineTransform
.Constructor Detail |
public AffineTransform()
AffineTransform
with all of its elements set to 0.public AffineTransform(int[][] elements) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
AffineTransform
with its elements set to the
values in the specified two-dimensional array. The outer array array must
contain 3 elements. Each of those elements must contain an array of 4
elements.
The data in those arrays is set as follows. The value at index [0][0]
represents the value described by the AffineTransform
field M00.
The value at index [0][3] represents the value described by the
AffineTransform
field M03.AffineTransform.MIN_VALUE
). Values larger than 32767
will be adjusted to 32767 (AffineTransform.MAX_VALUE
).
java.lang.IllegalArgumentException
- if the specified array has invalid size.java.lang.NullPointerException
- if the array is null
.MIN_VALUE
,
MAX_VALUE
,
M00
,
M01
,
M02
,
M03
,
M10
,
M11
,
M12
,
M13
,
M20
,
M21
,
M22
,
M23
Method Detail |
public int get(int fieldID)
AffineTransform
matrix element value.
The fieldID
parameter should be one of the field values
specified in the AffineTransform
class.
fieldID
- the ID of the matrix element value to return.java.lang.IllegalArgumentException
- if the field ID is not valid.M00
,
M01
,
M02
,
M03
,
M10
,
M11
,
M12
,
M13
,
M20
,
M21
,
M22
,
M23
public void set(int fieldID, int value) throws java.lang.IllegalArgumentException
AffineTransform
matrix element with the specified value.
The fieldID
parameter should be one of the field values
specified in the AffineTransform
class.
The specified value must be in the range -32768 to 32767. Values
smaller than -32768 will be adjusted to -32768 (
AffineTransform.MIN_VALUE
). Values larger than 32767
will be adjusted to 32767 (AffineTransform.MAX_VALUE
).
fieldID
- the ID of the matrix element being set.value
- the value to set that element to.java.lang.IllegalArgumentException
- if the field ID is not valid.MIN_VALUE
,
MAX_VALUE
,
M00
,
M01
,
M02
,
M03
,
M10
,
M11
,
M12
,
M13
,
M20
,
M21
,
M22
,
M23
public void set(int[][] elements) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
AffineTransform
matrix elements with the integers in
the specified two-dimensional array. The outer array array must contain 3
elements. Each of those elements must contain an array of 4 elements.
All values in the array must be in the range -32768 to 32767. Values
smaller than -32768 will be adjusted to -32768 (
AffineTransform.MIN_VALUE
). Values larger than 32767
will be adjusted to 32767 (AffineTransform.MAX_VALUE
).
java.lang.IllegalArgumentException
- if the specified array has invalid size.java.lang.NullPointerException
- if the array is null
.MIN_VALUE
,
MAX_VALUE
public static AffineTransform getViewPointTransform(Vector3D position, Vector3D look, Vector3D up) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
position
- a Vector3D containing the viewpoint position.look
- a Vector3D containing the view direction vector from the
viewpoint.up
- a Vector3D containing the up direction vector from the viewpoint.java.lang.NullPointerException
- if any of the vectors are null
.java.lang.IllegalArgumentException
- if look or up are zero vectors or are
parallel to each other.public void rotateX(int angle)
angle
- the angle of rotation.public void rotateY(int angle)
angle
- the angle of rotation.public void rotateZ(int angle)
angle
- the angle of rotation.public void rotateV(Vector3D axis, int angle) throws java.lang.NullPointerException
axis
- the unit vector for the rotation.angle
- the angle of rotation.java.lang.NullPointerException
- if the axis is null
.public Vector3D transformPoint(Vector3D source) throws java.lang.NullPointerException
AffineTransform
.
source
- the Vector3D containing the point to transform.java.lang.NullPointerException
- if the source point is null
.public void multiply(AffineTransform multiplier) throws java.lang.NullPointerException
AffineTransform
object against another.
The result is stored within the AffineTransform
the method was
called on.multiplier
- the AffineTransform
to multiply this
AffineTransform
with.java.lang.NullPointerException
- if the multiplier is null
.public static AffineTransform multiply(AffineTransform multiplicand, AffineTransform multiplier) throws java.lang.NullPointerException
AffineTransform
objects against another.
The result is returned in a new AffineTransform
instance.multiplicand
- the AffineTransform
serving as the multiplicand.multiplier
- the AffineTransform
serving as the multiplier.AffineTransform
containing the result.java.lang.NullPointerException
- if either the multiplicand or the multiplier
is null
.public static void multiply(AffineTransform destination, AffineTransform multiplicand, AffineTransform multiplier) throws java.lang.NullPointerException
AffineTransform
objects and stores the result
of the operation in the specified destination.
destination
- the AffineTransform
that should hold the result.multiplicand
- the AffineTransform
serving as the multiplicand.multiplier
- the AffineTransform
serving as the multiplier.java.lang.NullPointerException
- if any of the specified parameters
is null
.public void normalize()
AffineTransform
.
If this is a zero matrix this method does nothing. A zero matrix is a
matrix with all elements equal to zero.public void setIdentity()
AffineTransform
to an identity matrix.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |