net.dzzd.access
Interface IAxis3D


public interface IAxis3D

Axis3D.Interface

Usualy Axis3D are used to define 3D scene objects local axis.

Axis3D can also be useful to compute 3D space math & transformations.


Overwiev of a 3D scene objects local axis :

Since:
1.0
Version:
1.0, 01/01/04
Author:
Bruno Augier
See Also:
IScene3DObject, IPoint3D

Method Summary
 IAxis3D add(double x, double y, double z)
          Add/Move this axis by a given vector.
 IAxis3D add(IPoint3D point)
          Add/Move this axis by a given 3d point.
 IAxis3D copy(IAxis3D source)
          Copy value from an other axis3D.
 IPoint3D getAX()
          Gets a snapshot of the x axis (ax) in the current space.
 IPoint3D getAY()
          Gets a snapshot of the y axis (ay) in the current space.
 IPoint3D getAZ()
          Gets a snapshot of the z axis (az) in the current space.
 IPoint3D getOrigin()
          Gets origine for axis3D in the current space.
 IAxis3D getRotationXZY(IPoint3D rotation)
          Update the given 3d point with the rotation of this axis.
 IAxis3D init()
          Initialise this axis3D.
 IAxis3D rotate(double angle, double x, double y, double z)
          Rotate this axis3D around and arbitrary axis.
 IAxis3D rotate(double angle, double px, double py, double pz, double x, double y, double z)
          Rotate this axis3D around and arbitrary axis using a specific pivot point.
 IAxis3D rotate(double angle, double px, double py, double pz, IPoint3D axis)
          Rotate this axis3D around and arbitrary axis using a specific pivot point.
 IAxis3D rotate(double angle, IPoint3D axis)
          Rotate this axis3D around and arbitrary axis.
 IAxis3D rotate(double angle, IPoint3D pivot, IPoint3D axis)
          Rotate this axis3D around and arbitrary axis using a specific pivot point.
 IAxis3D rotateX(double angle)
          Rotate this axis3D around the X axis.
 IAxis3D rotateY(double angle)
          Rotate this axis3D around the Y axis.
 IAxis3D rotateZ(double angle)
          Rotate this axis3D around the Z axis.
 IAxis3D set(IPoint3D position, IPoint3D rotation)
          Update this Axis3D using given position & rotation.
 IAxis3D set(IPoint3D pivot, IPoint3D position, IPoint3D rotation)
          Update this Axis3D using given pivot,position & rotation.
 IAxis3D sub(double x, double y, double z)
          Substract/Move this axis by a given vector.
 IAxis3D sub(IPoint3D point)
          Substract/Move this axis by a given 3d point.
 IAxis3D toAxis(IAxis3D a)
          Put this axis in the given axis space
 IAxis3D toLocalAxis(IAxis3D a)
          Transform this axis values into the local axis a
 

Method Detail

getAX

public IPoint3D getAX()
Gets a snapshot of the x axis (ax) in the current space.

Returns:
interface to acces to x,y,z components of the x axis (ax)

getAY

public IPoint3D getAY()
Gets a snapshot of the y axis (ay) in the current space.

Returns:
interface to acces to x,y,z components of the y axis (ay)

getAZ

public IPoint3D getAZ()
Gets a snapshot of the z axis (az) in the current space.

Returns:
interface to acces to x,y,z components of the z axis (az)

getOrigin

public IPoint3D getOrigin()
Gets origine for axis3D in the current space.

Returns:
interface to acces to x,y,z components of the origine of the axis3D

copy

public IAxis3D copy(IAxis3D source)
Copy value from an other axis3D.

Parameters:
source - source axis3D to copy value from.
Returns:
this axis3D.

rotateX

public IAxis3D rotateX(double angle)
Rotate this axis3D around the X axis.

X axis means vector(1,0,0) and does not means this axis AX vector.

You may call myaxis.rotate(angle,myaxis.getAX()) to rotate "myaxis" around it own AX axis.

Parameters:
angle - rotation angle expressed in radian.
Returns:
this axis3D.

rotateY

public IAxis3D rotateY(double angle)
Rotate this axis3D around the Y axis.

Y axis means vector(0,1,0) and does not means this axis AY vector.

You may call myaxis.rotate(angle,myaxis.getAY()) to rotate "myaxis" around it own AY axis.

Parameters:
angle - rotation angle expressed in radian.
Returns:
this axis3D.

rotateZ

public IAxis3D rotateZ(double angle)
Rotate this axis3D around the Z axis.

Z axis means vector(0,0,1) and does not means this axis AZ vector.

You may call myaxis.rotate(angle,myaxis.getAZ()) to rotate "myaxis" around it own AZ axis.

Parameters:
angle - rotation angle expressed in radian.
Returns:
this axis3D.

rotate

public IAxis3D rotate(double angle,
                      double x,
                      double y,
                      double z)
Rotate this axis3D around and arbitrary axis.

Parameters:
angle - rotation angle expressed in radian.
x - rotation axis x component.
y - rotation axis y component.
z - rotation axis z component.
Returns:
this axis3D.

rotate

public IAxis3D rotate(double angle,
                      double px,
                      double py,
                      double pz,
                      double x,
                      double y,
                      double z)
Rotate this axis3D around and arbitrary axis using a specific pivot point.

Parameters:
angle - rotation angle expressed in radian.
px - pivot point x position.
py - pivot point y position.
pz - pivot point z position.
x - rotation axis x component relative to pivot point.
y - rotation axis y component relative to pivot point.
z - rotation axis z component relative to pivot point.
Returns:
this axis3D.

rotate

public IAxis3D rotate(double angle,
                      IPoint3D axis)
Rotate this axis3D around and arbitrary axis.

Parameters:
angle - rotation angle expressed in radian.
axis - rotation axis.
Returns:
this axis3D.

rotate

public IAxis3D rotate(double angle,
                      double px,
                      double py,
                      double pz,
                      IPoint3D axis)
Rotate this axis3D around and arbitrary axis using a specific pivot point.

Parameters:
angle - rotation angle expressed in radian.
px - pivot point x position.
py - pivot point y position.
pz - pivot point z position.
axis - rotation axis relative to pivot point.
Returns:
this axis3D.

rotate

public IAxis3D rotate(double angle,
                      IPoint3D pivot,
                      IPoint3D axis)
Rotate this axis3D around and arbitrary axis using a specific pivot point.

Parameters:
angle - rotation angle expressed in radian.
pivot - pivot point.
axis - rotation axis relative to pivot point.
Returns:
this axis3D.

add

public IAxis3D add(double x,
                   double y,
                   double z)
Add/Move this axis by a given vector.

Parameters:
x - vector x component.
y - vector y component.
z - vector z component.
Returns:
this axis3D.

sub

public IAxis3D sub(double x,
                   double y,
                   double z)
Substract/Move this axis by a given vector.

Parameters:
x - vector x component.
y - vector y component.
z - vector z component.
Returns:
this axis3D.

add

public IAxis3D add(IPoint3D point)
Add/Move this axis by a given 3d point.

Parameters:
point - vector.
Returns:
this axis3D.

sub

public IAxis3D sub(IPoint3D point)
Substract/Move this axis by a given 3d point.

Parameters:
point - vector.
Returns:
this axis3D.

getRotationXZY

public IAxis3D getRotationXZY(IPoint3D rotation)
Update the given 3d point with the rotation of this axis.

this function will update the given point3d with the rotations that must be applied to a new axis3D to get the same axis.

ex:

axis.getRotationXZY(rotation);

To get a new axis3D aligned to this axis you can do the following:

newAxis.rotateX(rotation.getX()).rotateZ(rotation.getZ()).rotateY(rotation.getY())

Note: rotations must be applied in the following order : RX,RZ,RY.

Parameters:
rotation - point that will received the axis3D rotation rx,ry,rz.
Returns:
this axis3D.

toLocalAxis

public IAxis3D toLocalAxis(IAxis3D a)
Transform this axis values into the local axis a

Parameters:
a - an axis to transform axis to
Returns:
same axis "viewed" by axis a

toAxis

public IAxis3D toAxis(IAxis3D a)
Put this axis in the given axis space

Parameters:
a - an axis to transform to its space
Returns:
same axis in given axis space

init

public IAxis3D init()
Initialise this axis3D.

this function will do the following
- set Origin to (0,0,0)
- set AX to (1,0,0)
- set AY to (0,1,0)
- set AZ to (0,0,1)

Returns:
this axis3D.

set

public IAxis3D set(IPoint3D pivot,
                   IPoint3D position,
                   IPoint3D rotation)
Update this Axis3D using given pivot,position & rotation.

Parameters:
pivot - pivot to use
position - position to use
rotation - rotation to use
Returns:
this Axis3D updated

set

public IAxis3D set(IPoint3D position,
                   IPoint3D rotation)
Update this Axis3D using given position & rotation.

Parameters:
position - position to use
rotation - rotation to use
Returns:
this Axis3D updated