|
Jazz3D API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sygem.jazz3d3.Object3d | +--com.sygem.jazz3d3.primitive.Landscape3d
Create a fractal landscape object.
Object3d
Constructor Summary | |
Landscape3d(double x,
double y,
double z)
Construct a new landscape. |
|
Landscape3d(int seed,
double x,
double y,
double z)
Construct a new landscape based on a given random seed. |
Method Summary | |
void |
addColour(double min,
int r,
int g,
int b)
Assigns a colour to every point above a given height. |
void |
addRandomValues()
Adds a random set of values to every point in the landscape. |
void |
addRandomValues(double min,
double max)
Adds a random set of values to every point in the landscape. |
void |
forceEdgesToZero()
All of the edges of the landscape will be set to zero. |
void |
fractalize()
Adds another level of randomness to the landscape. |
void |
generateShape()
Generates the triangles which actually make up the landscape. |
void |
setSeed(int seed)
Set the seed to be used in the random number generator. |
void |
setSingleSided(boolean sided)
Allows you to toggle if the faces are single-sided or not. |
void |
smooth()
Smooths the landscape. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Landscape3d(int seed, double x, double y, double z)
seed
- The seed to use for the random number routine.x
- The x position of the center of the landscapey
- The y position of the center of the landscapez
- The z position of the center of the landscapepublic Landscape3d(double x, double y, double z)
x
- The x position of the center of the landscapey
- The y position of the center of the landscapez
- The z position of the center of the landscapeMethod Detail |
public final void fractalize()
For example: it goes from a 2x2 grid, to a 4x4 grid, to an 8x8 grid and so on. This can quickly generate a large number of faces, so beware, because the objects will take a long time to draw with a large number of faces.
public final void smooth()
public final void generateShape()
NOTE: If this is not called, then the object will not render!
public final void setSeed(int seed)
seed
- The new random seed.public final void addRandomValues()
The values will range from -0.5 to 0.5
public final void addRandomValues(double min, double max)
min
- The minimum value for the random valuesmax
- The maximum value for the random valuespublic final void addColour(double min, int r, int g, int b)
min
- A value between zero and one.r
- The red value of the colour. Ranges from 0 to 255.g
- The green value of the colour. Ranges from 0 to 255.b
- The blue value of the colour. Ranges from 0 to 255.public final void setSingleSided(boolean sided)
sided
- True if the faces should be single-sided, false if not.public final void forceEdgesToZero()
|
©2001 SyGem Software |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |