|
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.terrain.HeightDataCreator
public class HeightDataCreator
A converter utility for changing an image into a height field set of data points.
To translate an image to a height field, the width of the image (X values) translates to the width of the geometry. The height of the image (Y values) is translated to the depth of the terrain. A terrain is always generated in the X-Z plain and height values along the Y axis.
Constructor Summary | |
---|---|
HeightDataCreator()
Create a default data creator with the min and max heights set to 0 and 1. |
|
HeightDataCreator(float min,
float max)
Create a data creator that has the minimum and maximum heights set but uses the default spacing of the cells. |
Method Summary | |
---|---|
float[][] |
createHeightField(java.awt.image.BufferedImage img)
Convert an image into a set of terrain points. |
void |
setHeightRange(float min,
float max)
Set the height range values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HeightDataCreator()
public HeightDataCreator(float min, float max)
min
- The minimum height of the imagemax
- The maximum height of the image
java.lang.IllegalArgumentException
- The minimum was greater than maxMethod Detail |
---|
public void setHeightRange(float min, float max)
min
- The minimum height of the imagemax
- The maximum height of the image
java.lang.IllegalArgumentException
- The minimum was greater than maxpublic float[][] createHeightField(java.awt.image.BufferedImage img)
Range values are taken according to the preset values supplied elsewhere.
img
- The image to convert
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |