DirectX Media for Animation Java Reference Previous
Previous
Classes
Classes
Index
Index
Next
Next

Transform3Bvr Class

Methods , Fields

public class Transform3Bvr extends Behavior {
    // Fields
    public static Transform3Bvr identityTransform3;

    // Methods
    public static Transform3Bvr compose(Transform3Bvr xf1, Transform3Bvr xf2);
    public static Transform3Bvr inverse(Transform3Bvr xf1);
    public static BooleanBvr    isSingular(Transform3Bvr xf1);
    public static Transform3Bvr lookAtFrom(Point3Bvr from, Point3Bvr to, Vector3Bvr up);
    public static Transform3Bvr newUninitBvr();
    public static Transform3Bvr rotate(Vector3Bvr axis, NumberBvr radians);
    public static Transform3Bvr scale(NumberBvr sx, NumberBvr sy, NumberBvr sz);
    public static Transform3Bvr scale(Vector3Bvr v);
    public static Transform3Bvr scale3(NumberBvr uniformFactor);
    public static Transform3Bvr transform4x4( 
        NumberBvr a00, NumberBvr a01, NumberBvr a02, NumberBvr a03, 
        NumberBvr a10, NumberBvr a11, NumberBvr a12, NumberBvr a13, 
        NumberBvr a20, NumberBvr a21, NumberBvr a22, NumberBvr a23, 
        NumberBvr a30, NumberBvr a31, NumberBvr a32, NumberBvr a33);
    public static Transform3Bvr translate(NumberBvr tx, NumberBvr ty, NumberBvr tz);
    public static Transform3Bvr translate(Vector3Bvr v);
    public static Transform3Bvr xShear(NumberBvr a, NumberBvr b);
    public static Transform3Bvr yShear(NumberBvr c, NumberBvr d);
    public static Transform3Bvr zShear(NumberBvr e, NumberBvr f);
    }

Just as a Transform2Bvr transforms a two-dimensional object into another two-dimensional object, a Transform3Bvr transforms a three-dimensional object into another three-dimensional object. Other transforms include the render method, which transforms three-dimensional objects into two-dimensional objects, and the project method, which transforms a three-dimensional point into a two-dimensional point.

For more information about behaviors, see the Behavior class.


Methods


compose

public static Transform3Bvr compose(Transform3Bvr xf1, Transform3Bvr xf2);

Creates a three-dimensional transformation behavior that is a composition of the given transformation behaviors.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
xf1 and xf2 The Transform3Bvr objects.

Remarks:

Composing a transform is equivalent to first applying xf2 and then applying xf1. In other words:


geo.transform(compose(xf1, xf2) == geo.transform(xf2).transform(xf1)

inverse

public static Transform3Bvr inverse();

Creates a transformation behavior that is the inverse of the original transformation. The inverse transformation is useful for removing the effects of the original transformation from a three-dimensional object.

Return Value:

Returns the Transform3Bvr object.


isSingular

public static BooleanBvr isSingular();

Creates a Boolean behavior that indicates whether the transform is singular or not. A singular transform is one that has no inverse.

Return Value:

Returns the BooleanBvr object. This object's value is true if the transform is singular; otherwise, it is false.


lookAtFrom

public static Transform3Bvr lookAtFrom(Point3Bvr from, Point3Bvr to, Vector3Bvr up);

Creates a three-dimensional transformation behavior that transforms an object from a standard position and orientation to the "from" point, and aimed at the "to" point, with "up" mapping to the object's up direction. Prior to this transform, objects must be located at the origin, with the up side aligned with positive y, and aimed in the negative z-direction.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
from The Point3Bvr object specifying the point from which to view.
to The Point3Bvr object specifying the point toward which to view.
up The Point3Bvr object specifying the point determining the upright position.

Remarks:

This transform is useful for positioning and orienting cameras, lights, microphones, and other three-dimensional objects.


newUninitBvr

public static Transform3Bvr newUninitBvr();

This method allows you to refer to an Transform3Bvr behavior before that behavior has been defined. With this method you can create the behavior and use it in the definition of other behaviors, but not actually define its contents until some later point. (This is accomplished with the init method, which is available on all behaviors.) The system generates a run-time error if you initialize a non-uninitialized behavior, initialize an uninitialized behavior that has already been initialized, or run an initialized behavior that has not yet been initialized.

Return Value:

Returns the Transform3Bvr object.


rotate

public static Transform3Bvr rotate(Vector3Bvr axis, NumberBvr radians);

Creates a three-dimensional transformation behavior that when applied to a point or vector behavior rotates the point or vector by the given angle in radians around the given axis.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
axis The Vector3Bvr object representing the axis around which to rotate. The plane of rotation is perpendicular to the ray defined by this vector.
radians The NumberBvr object representing the angle to rotate.

Remarks:

Rotations obey the right-hand rule. This means that, when looking down the axis vector, they are counter-clockwise.


scale

public static Transform3Bvr scale(NumberBvr sx, NumberBvr sy, NumberBvr sz);

Creates a three-dimensional transformation behavior that, when applied to a three-dimensional object, scales it. For example, the transformation modifies the length of a vector by multiplying the vector's coordinates by the values of the corresponding number behaviors.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
sx, sy, and sz The NumberBvr objects representing the amount to scale. The value of sx applies to the x coordinate, sy to the y coordinate, and sz to the z coordinate.


scale

public static Transform3Bvr scale(Vector3Bvr v);

Creates a three-dimensional transformation behavior that, when applied to a three-dimensional object, scales it. For example, the transformation modifies the location of a point by multiplying the point's coordinates by the values of the corresponding vector coordinates.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
v The Vector3Bvr object. The x, y, and z coordinates of the vector behavior specify the amount to scale the x, y, and z coordinates, respectively.


scale3

public static Transform3Bvr scale3(NumberBvr uniformFactor);

Creates a three-dimensional transformation behavior that, when applied to a three-dimensional object, scales it uniformly.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
uniformFactor The NumberBvr object representing the value to apply to both the x, y, and z coordinates, respectively.

See Also: scale, scale


transform4x4

public static Transform3Bvr transform4x4( 
    NumberBvr a00, NumberBvr a01, NumberBvr a02, NumberBvr a03, 
    NumberBvr a10, NumberBvr a11, NumberBvr a12, NumberBvr a13, 
    NumberBvr a20, NumberBvr a21, NumberBvr a22, NumberBvr a23, 
    NumberBvr a30, NumberBvr a31, NumberBvr a32, NumberBvr a33);

Creates a three-dimensional transformation behavior that consists of the 4 by 4 matrix having the values specified by the given number behaviors.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
a00, a01, a02, a03 The NumberBvr objects representing the top row of the matrix. Use a00 to scale the x coordinate and a03 to translate x.
a10, a11, a12, a13 The NumberBvr objects representing the second row of the matrix. Use a11 to scale the y coordinate and a13 to translate y.
a20, a21, a22, a23 The NumberBvr objects representing the third row of the matrix. Use a22 to scale the z coordinate and a23 to translate z.
a30, a31, a32, a33 The NumberBvr objects representing the bottom row of the matrix.

Remarks:

The translation components for the matrix are in the last column. All a3X components must be [0 0 0 1].


translate

public static Transform3Bvr translate(NumberBvr tx, NumberBvr ty, NumberBvr tz);

Creates a three-dimensional transformation behavior that when applied to a point behavior translates (moves) the point by the amount given by the number behaviors.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
tx, ty, and tz The NumberBvr objects representing the amount to translate the point along the x, y, and z axes, respectively.

Remarks:

Vectors are unchanged by translations.


translate

public static Transform3Bvr translate(Vector3Bvr v);

Creates a three-dimensional transformation behavior that when applied to a point behavior translates (moves) the point by the amount given by the vector behavior.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
v The Vector3Bvr object. The x, y, and z coordinates of the vector behavior specify the amount to translate along the x, y, and z axes, respectively.

Remarks:

Vectors are unchanged by translations.


xShear

public static Transform3Bvr xShear(NumberBvr a, NumberBvr b);

Shears the x-axis in the positive y-direction by a and in the positive z-direction by b.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
a The NumberBvr object representing the amount of shear in the Y direction.
b The NumberBvr object representing the amount of shear in the Z direction.

See Also: yShear, zShear


yShear

public static Transform3Bvr yShear(NumberBvr c, NumberBvr d);

Shears the y-axis in the positive x-direction by c and in the positive z-direction by d

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
c The NumberBvr object representing the amount of shear in the X direction.
d The NumberBvr object representing the amount of shear in the Z direction.

See Also: xShear, zShear


zShear

public static Transform3Bvr zShear(NumberBvr e, f);

Shears the z-axis in the postive x-direction by e and in the positive y-direction by f.

Return Value:

Returns the Transform3Bvr object.

ParameterDescription
e The NumberBvr object representing the amount of shear in the X direction.
f The NumberBvr object representing the amount of shear in the Y direction.

See Also: xShear, yShear


Fields

identityTransform3
A three-dimensional transformation behavior (Transform3Bvr object) that leaves the three-dimensional space unchanged. Applying this transformation to a point or vector produces the same point or vector.


Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.