Class CylinderCreator
java.lang.Object
|
+--CylinderCreator
- public class CylinderCreator
- extends java.lang.Object
This class creates a Cylinder in whatever orientation YOU want!
Provide two endpoints, and this will do the necessary transformations on
the Java3D Cylinder class for you, returning the Cylinder in a BranchGroup.
Constructor Summary |
CylinderCreator()
Constructs a cylinder with 7 edges by default. |
Method Summary |
javax.media.j3d.BranchGroup |
create(javax.vecmath.Point3d b,
javax.vecmath.Point3d a,
double radius,
javax.media.j3d.Appearance cylApp)
Creates a cylinder. |
void |
setResolution(int e)
Sets the resolution (number of edges) of the Cylinder. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
CylinderCreator
public CylinderCreator()
- Constructs a cylinder with 7 edges by default.
setResolution
public void setResolution(int e)
- Sets the resolution (number of edges) of the Cylinder.
- Parameters:
e
- Number of edges (e.g. 8 would look like a stop sign).
create
public javax.media.j3d.BranchGroup create(javax.vecmath.Point3d b,
javax.vecmath.Point3d a,
double radius,
javax.media.j3d.Appearance cylApp)
- Creates a cylinder.
- Parameters:
b
- coordinates of the base of the cylinder.a
- coordinates of the top of the cylinder.radius
- radius of the cylinder.cylApp
- cylinder Appearance.- Returns:
- A BranchGroup containing the cylinder in the desired orientation.