Axis Class

Realsoft 3D Axis.

Axis object consists of two attributes: position and direction. It can be used, for example, for representing vertices and associated vertex normals.

pos - vector defining origin (position) dir - vector defining direction For example:

o = new r3Vect(0.2, 0, 0);
d = new r3Vect(1, 0, 0);
a = new r3Axis(o, d);

Methods
Method:

r3Axis - constructor

Syntax:

a = new r3Axis()

Parameters:

vPos, vDir - two vectors specifying origin and direction

Returns:

new axis object

Description:

Creates a new axis object. If no parameters are passed to the constructor, a null axis system is created (both attributes will be null vectors). If the number of parameters is two, then the constructor assumes that the parameters are vectors defining position and direction.

Example:

// create an identity axis

Method:

identity - identity

Syntax:

a.identity();

Parameters:

-

Returns:

-

Description:

Reset axis to identity state. This corresponds to the following code: a.pos.set(0, 0, 0); a.dir.set(0, 0, 0);

Example:

cs.identity();

Method:

normalize - normalize dir vector

Syntax:

a.normalize();

Parameters:

-

Returns:

-

Description:

Normalize dir vector to unit vector. This corresponds to the following code: a.dir.norm();

Example:

a.normalize();

Method:

print - dump values

Syntax:

a.print();

Parameters:

-

Returns:

-

Description:

Print current values of the axis object. Useful for debugging purposes.

Example:

a.print();