com.cult3d.world
Class CultObject

java.lang.Object
  |
  +--com.cult3d.world.CultObject

public class CultObject
extends java.lang.Object

This class provides a representation of a Cult3D object.

Here is an example which creates an CultObject. After creation a rotatin around the x-axis and a translation along the y-axis is performed.

 
	CultObject cube = new CultObject("RedCube");
	cube.rotate(cube.X, 2.0);
	cube.translate(0.0, 1.0, 0.0);
 
 


Field Summary
static int X
          The x-axis.
static int Y
          The y-axis.
static int Z
          The z-axis.
 
Constructor Summary
CultObject(java.lang.String name)
          Constructs a Java representation of a Cult3D object.
 
Method Summary
 void rotate(int axis, float amount)
          Rotates the object.
 void translate(float amountx, float amounty, float amountz)
          Translates the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X

public static final int X
The x-axis.

Y

public static final int Y
The y-axis.

Z

public static final int Z
The z-axis.
Constructor Detail

CultObject

public CultObject(java.lang.String name)
Constructs a Java representation of a Cult3D object.
Parameters:
name - the name of the object.
Throws:
NameNotFoundException - for invalid name.
Method Detail

rotate

public void rotate(int axis,
                   float amount)
Rotates the object. The object is rotated around an axis in the objects own reference frame.
Parameters:
axis - the axis to rotate around.
amount - the amount in radians.
Throws:
java.lang.IllegalArgumentException - for invalid axis

translate

public void translate(float amountx,
                      float amounty,
                      float amountz)
Translates the object. The object is translated along the axes in the objects own reference frame.
Parameters:
amountx - the amount to translate along x-axis.
amounty - the amount to translate along y-axis.
amountz - the amount to translate along z-axis.