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

Point3Bvr Class

Methods , Fields

public class Point3Bvr extends Behavior {
    // Fields
    public static Point3Bvr origin3;

    // Methods
    public NumberBvr getPhi();
    public NumberBvr getRho();
    public NumberBvr getTheta();
    public NumberBvr getX();
    public NumberBvr getY();
    public NumberBvr getZ();
    public Point2Bvr project(CameraBvr camera)
    public Point3Bvr transform(Transform3Bvr xf);
    
    public static Point3Bvr  add(Point3Bvr pt, Vector3Bvr vec);
    public static Point3Bvr  bSpline(int degree, NumberBvr[] knots, Point3Bvr[] control_elements, NumberBvr[] weights);
    public static Vector3Bvr derivative(Point3Bvr pt);
    public static NumberBvr  distance(Point3Bvr p1, Point3Bvr p2);
    public static NumberBvr  distanceSquared(Point3Bvr p1, Point3Bvr p2);
    public static Point3Bvr  newUninitBvr();
    public static Point3Bvr  point3Spherical(NumberBvr theta, NumberBvr phi, NumberBvr rho);
    public static Point3Bvr  point3Xyz(NumberBvr x, NumberBvr y, NumberBvr z);
    public static Vector3Bvr sub(Point3Bvr p1, Point3Bvr p2);
    public static Point3Bvr  sub(Point3Bvr pt, Vector3Bvr vec);
}

Creates an object that represents a three-dimensional point behavior. At any given time, the value of the behavior is a point, representing a location in a three-dimensional space. Each point has a triplet of coordinate values that define the point's location relative to a fixed point called the origin. These coordinate values are given as either Cartesian coordinates (x,y, z) or spherical coordinates (theta,phi,rho) when the point behavior is created.

Because coordinate values are number behaviors (NumberBvr objects), the location of a point behavior may change over time as the number behaviors change. For more information about behaviors, see the Behavior class.


Methods


getPhi

public NumberBvr  getPhi();

Returns the number behavior of the phi coordinate of the given point's polar coordinates. Phi is the elevation angle, in radians, going up from the XZ-plane towards the positive y-ray.

Return Value:

Returns the NumberBvr object.

See Also: getTheta, getRho, point3Spherical


getRho

public NumberBvr  getRho();

Returns the number behavior of the rho coordinate of the given point's polar coordinates. Rho is the distance of the point from the origin.

Return Value:

Returns the NumberBvr object.

See Also: getTheta, getPhi, point3Spherical


getTheta

public NumberBvr  getTheta();

Returns the number behavior of the theta coordinate of the given point's polar coordinates. Theta is the counter-clockwise angle, in radians, of the point about the y-axis, starting at positive z.

Return Value:

Returns the NumberBvr object.

See Also: getPhi, getRho, point3Spherical


getX

public NumberBvr  getX();

Creates a number behavior that represents the x coordinate of this point behavior.

Return Value:

Returns the NumberBvr object.

See Also: getY, getZ, point3Xyz


getY

public NumberBvr  getY();

Creates a number behavior that represents the y coordinate of this point behavior.

Return Value:

Returns the NumberBvr object.

See Also: getX, getZ, point3Xyz


getZ

public NumberBvr  getZ();

Creates a number behavior that represents the z coordinate of this point behavior.

Return Value:

Returns the NumberBvr object.

See Also: getX, getY, point3Xyz


project

public Point2Bvr project(CameraBvr camera);

Returns the two-dimensional point behavior of the projection of the three-dimensional point onto the image plane, via the given camera behavior.

Return Value:

Returns the Point2Bvr object.

ParameterDescription
camera The CameraBvr object projecting the three-dimensional point onto the image plane.


transform

public Point3Bvr  transform(Transform3Bvr xf);

Creates a new three-dimensional point behavior that is the result of applying the given transformation to the original point behavior.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
xf The Transform3Bvr object.

Remarks:

This attribute composes values.


add

public static Point3Bvr  add(Point3Bvr pt, Vector3Bvr vec);

Creates a three-dimensional point behavior. The location of the point is calculated by adding the corresponding coordinates of the given point and vector behaviors.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
pt A Point3Bvr object.
vec A Vector3Bvr object.

See Also: sub


bSpline

public static Point3Bvr bSpline(int degree, NumberBvr[] knots, Point3Bvr[] control_elements, NumberBvr[] weights);

Creates a Point3Bvr behavior that defines a B-spline curve from which individual point behaviors, representing positions on the curve, can be evaluated. The shape of the curve depends on the mathematical degree of curve and whether weights are provided.

A B-spline with weights is rational, and without weights is non-rational (polynomial). The non-rational variety assumes that #points = numKnots - degree + 1. The knots represent known positions along the curve, and the control points define the direction and shape of the curve as it passes from one knot to the next.

Given a degree of curve d and a number of knots k, a position on the curve can be evaluated for any value in the range knotd to knotk-d+1. For example, for a degree 2 curve, the valid range is from the second knot to the next to the last knot, inclusive.

The returned Point3Bvr behavior is the evaluation of the spline curve according to time. By default, the spline parameter advances at a rate of one unit per second. To control the evaluation of the curve, use the substituteTime method. Times outside the valid range are clamped to the values at the endpoints of the spline.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
degree A number representing the mathematical degree of the B-spline to evaluate. Must be 1, 2, or 3.
knots An array of NumberBvr objects representing the knots used to calculate the B-spline.
control_elements An array of Point3Bvr objects representing the control elements used to calculate the B-spline.
weights An array of NumberBvr objects representing the weights used to calculate the B-spline. There must be the same number of weights as control elements. For non-rational B-splines, the value of weights is null.


derivative

public static Vector3Bvr derivative(Point3Bvr pt);

Creates a three-dimensional vector behavior of the instantaneous derivative (rate of change) of the given point behavior. For example, a constant yields a constant derivative of [0 0 0], and point3Xyz(time, 0) (without additional time substitutions) yields a constant derivative of [1 0 0].

Return Value:

Returns the Vector3Bvr object.

ParameterDescription
pt A Point3Bvr object.


distance

public static NumberBvr  distance(Point3Bvr p1, Point3Bvr p2);

Creates a number behavior representing the distance between two point behaviors.

Return Value:

Returns the NumberBvr object.

ParameterDescription
p1 and p3 The Point3Bvr objects.

See Also: distanceSquared


distanceSquared

public static NumberBvr  distanceSquared(Point3Bvr p1, Point3Bvr p2);

Creates a number behavior representing the square of the distance between two point behaviors. This is the same as the distance method except that the distance is squared.

Return Value:

Returns the NumberBvr object.

ParameterDescription
p1 and p3 The Point3Bvr objects.

Remarks:

This method is slightly more efficient than the distance method.

See Also: distance


newUninitBvr

public static Point3Bvr newUninitBvr();

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


point3Spherical

public static Point3Bvr point3Spherical(NumberBvr theta, NumberBvr phi, NumberBvr rho);

Creates a three-dimensional point behavior. The location of the point is given in spherical coordinates.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
theta A NumberBvr object of the counter-clockwise azimuthal angle, in radians, of the point about the positive y-ray. The angle begins at the positive z-ray, so that [0 0 1] has a theta of 0, and [1 0 0] has a theta of pi/2.
phi A NumberBvr object of the counter-clockwise elevation angle, in radians, of the point above the XZ-plane. A phi of pi/2 means the point is straight up (on the positive y-ray), and a phi of -pi/2 is straight down (on the negative y-ray).
rho A NumberBvr object of the distance of the point from the origin.

Remarks:

The following table correlates Cartesian coordinates with polar coordinates:
Cartesian Theta Phi Rho
Coordinates
[0 0 0] X X 0
[d 0 0] pi/2 0 d
[-d 0 0] -pi/2 0 d X = Don't Care
[0 d 0] X pi/2 d
[0 -d 0] X -pi/2 d
[0 0 d] 0 0 d
[0 0 -d] pi 0 d

See Also: point3Xyz


point3Xyz

public static Point3Bvr point3Xyz(NumberBvr x, NumberBvr y, NumberBvr z);

Creates a three-dimensional point behavior. The location of the point is given in Cartesian coordinates.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
x, y, and z The NumberBvr objects, specifying the coordinate values. The x specifies the distance along the x-axis from the origin to the point, y specifies the distance along the y-axis, and z the distance along the z-axis.

See Also: point3Spherical


sub

public static Vector3Bvr sub(Point3Bvr p1, Point3Bvr p2);

Creates a three-dimensional vector behavior. The coordinate values of the vector are calculated by subtracting the coordinates of p3 from the corresponding coordinates of p1.

Return Value:

Returns the Vector3Bvr object.

ParameterDescription
p1 and p3 The Point3Bvr objects.


sub

public static Point3Bvr  sub(Point3Bvr pt, Vector3Bvr vec);

Creates a three-dimensional point behavior. The location of the point is calculated by subtracting the coordinates of the given vector behavior from the corresponding coordinates of the given point behavior.

Return Value:

Returns the Point3Bvr object.

ParameterDescription
pt A Point3Bvr object.
vec A Vector3Bvr object.

See Also: add


Fields

origin3
A three-dimensional point behavior (Point3Bvr object) that is always located at the origin.


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