|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.GeometryGenerator org.j3d.geom.MobiusGenerator
public class MobiusGenerator
A mobius strip geometry generator with specified number of divisions per strip, number of strips, position, and appearance.
The generator is used to create Mobius strip shapes as geometry. The output are coordinates as quads suitable for use in an unindexed-quad array. The number of faces (polygons) generated is derived from the number of divisions times.
When normals are calculated, they are only generated for one side of the strip. When you create the Java3D geometry from this you should make sure to set the rendering attributes to be double sided.
The algorithm was adapted from Tore Nordstrand's Math Image Gallery: http://www.uib.no/people/nfytn/mathgal.htm (This algorithm is not perfect yet: The strips are slightly out of alignment. This is easy to see with a small number of strips
The current algorithm does not have control over the diameter of the strip created. I'd like to fix it but don't know where to start yet.
Constructor Summary | |
---|---|
MobiusGenerator()
Constructs a mobius strip with 28 divisions per strip, 14 strips. |
|
MobiusGenerator(int divisions,
int strips)
Constructs a mobius strip with number of divisions per strip and number of strips. |
Method Summary | |
---|---|
float[] |
generateUnindexedCoordinates()
Generates new set of points. |
void |
setDimensions(int divisions,
int strips)
Change the dimensions of the cone to be generated. |
Methods inherited from class org.j3d.geom.GeometryGenerator |
---|
createFaceNormal, createFaceNormal, createRadialNormal, createRadialNormal, generate, getVertexCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MobiusGenerator()
public MobiusGenerator(int divisions, int strips)
divisions
- The number of divisions to usestrips
- The number of strips to useMethod Detail |
---|
public void setDimensions(int divisions, int strips)
divisions
- The number of divisions to usestrips
- The number of strips to usepublic float[] generateUnindexedCoordinates()
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |