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

Transform2Bvr Class

Methods , Fields

public class Transform2Bvr extends Behavior {
    // Fields
    public static Transform2Bvr identityTransform2;

    // Methods
    public Transform2Bvr inverse();
    public BooleanBvr    isSingular();

    public static Transform2Bvr compose(Transform2Bvr xf1, Transform2Bvr xf2);
    public static Transform2Bvr newUninitBvr();
    public static Transform2Bvr rotate(NumberBvr radians);
    public static Transform2Bvr scale(NumberBvr sx, NumberBvr sy);
    public static Transform2Bvr scale(Vector2Bvr v);
    public static Transform2Bvr scale2(NumberBvr uniformFactor);
    public static Transform2Bvr transform3x2(NumberBvr a00, NumberBvr a01, NumberBvr a02, NumberBvr a10, NumberBvr a11, NumberBvr a12);
    public static Transform2Bvr translate(NumberBvr tx, NumberBvr ty);
    public static Transform2Bvr translate(Vector2Bvr v);
    public static Transform2Bvr xShear(NumberBvr x);
    public static Transform2Bvr yShear(NumberBvr y);
}

Creates an object that represents a two-dimensional transformation behavior. The behavior consists of a 3 by 2 matrix of number behaviors that can be applied to two-dimensional point behaviors to translate, scale, rotate or skew the location of the point, and can be applied to two-dimensional vector behaviors to scale, rotate, or skew the length and/or direction of the vector.

Because matrix values are number behaviors (NumberBvr objects), the transformation behavior may change over time as the number behaviors change. For more information about behaviors, see the Behavior class.


Methods


inverse

public Transform2Bvr 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 point or vector behavior.

Return Value:

Returns the Transform2Bvr object.


isSingular

public 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.


compose

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

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

Return Value:

Returns the Transform2Bvr object.

ParameterDescription
xf1 and xf2 The Transform2Bvr objects.

Remarks:

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


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

newUninitBvr

public static Transform2Bvr newUninitBvr();

This method allows you to refer to an Transform2Bvr 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 Transform2Bvr object.


rotate

public static Transform2Bvr rotate(NumberBvr radians);

Creates a two-dimensional transformation behavior that, when applied to any two-dimensional object, rotates it by the given angle in radians.

Return Value:

Returns the Transform2Bvr object.

ParameterDescription
radians The NumberBvr object representing the angle to rotate.

Remarks:

Rotations are counter-clockwise.


scale

public static Transform2Bvr scale(NumberBvr sx, NumberBvr sy);

Creates a two-dimensional transformation behavior that, when applied to any two-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 Transform2Bvr object.

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


scale

public static Transform2Bvr scale(Vector2Bvr v);

Creates a two-dimensional transformation behavior that, when applied to any two-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 Transform2Bvr object.

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


scale2

public static Transform2Bvr scale2(NumberBvr uniformFactor);

Creates a two-dimensional transformation behavior that applies a uniform scale to every coordinate of a two-dimensional object.

Return Value:

Returns the Transform2Bvr object.

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

See Also: scale, scale


transform3x2

public static Transform2Bvr transform3x2(NumberBvr a00, NumberBvr a01, NumberBvr a02, 
    NumberBvr a10, NumberBvr a11, NumberBvr a12);

Creates a two-dimensional transformation behavior that consists the 3 by 2 matrix having the values specified by the given number behaviors.

Return Value:

Returns the Transform2Bvr object.

ParameterDescription
a00, a01, and a02 The NumberBvr objects representing the top row of the matrix. Use a00 to scale the x coordinate and a02 to translate x.
a10, a11, and a12 The NumberBvr objects representing the bottom row of the matrix. Use a11 to scale the y coordinate and a12 to translate y.

Remarks:

The X and Y translation components are given by a02 and a12, respectively.


translate

public static Transform2Bvr translate(NumberBvr tx, NumberBvr ty);

Creates a two-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 Transform2Bvr object.

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

Remarks:

Two-dimensional vectors are unchanged by translations.


translate

public static Transform2Bvr translate(Vector2Bvr v);

Creates a two-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 Transform2Bvr object.

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

Remarks:

Two-dimensional vectors are unchanged by translations.


xShear

public static Transform2Bvr xShear(NumberBvr x);

Creates a two-dimensional transformation behavior that shears the x-axis either up or down. This means the X-coordinate of the points remain unchanged, and the Y-coordinate increases by the product of the X-coordinate and the shear factor.

Return Value:

Returns the Transform2Bvr object.

ParameterDescription
x The NumberBvr object representing the amount to shear.

See Also: yShear


yShear

public static Transform2Bvr yShear(NumberBvr y);

Creates a two-dimensional transformation behavior that shears the y-axis either left or right. This means the Y-coordinate of the points remains unchanged, and the X-coordinate increases by the product of the Y-coordinate and the shear factor.

Return Value:

Returns the Transform2Bvr object.

ParameterDescription
y The NumberBvr object representing the amount to shear.

See Also: xShear


Fields

identityTransform2
A two-dimensional transformation behavior (Transform2Bvr object) that leaves the two-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.