|
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.ColorRampGenerator
public class ColorRampGenerator
Utility class to create colors per vertex for a terrain model where the colour model is based on a ramp value.
This class is designed as a complement to the normal geometry generator
classes. The input is an existing, already created piece of geometry and
this adds the colour array to the GeometryData
. Colour
interpolation is based on using the
ColorInterpolator
running in RGB mode.
The alpha channel is optional and the caller has to know if they are supplying values with alpha or not. If alpha is used, the output array is in RGBA format in the array.
Values outside the range provided are clamped.
Internationalisation Resource Names
Constructor Summary | |
---|---|
ColorRampGenerator()
Construct a ramp generator with no color information set. |
|
ColorRampGenerator(float[] heights,
javax.vecmath.Color3f[] ramp)
Create a new colour ramp generator that uses the given heights and 3 component colour values for that height for the interpolation. |
|
ColorRampGenerator(float[] heights,
javax.vecmath.Color4f[] ramp)
Create a new colour ramp generator that uses the given heights and 4 component colour values for that height for the interpolation. |
|
ColorRampGenerator(float[] heights,
float[][] ramp)
Create a new colour ramp generator that uses the given heights and colour values for that height for the interpolation. |
|
ColorRampGenerator(float[] heights,
float[] ramp,
boolean hasAlpha)
Create a new colour ramp generator that uses the given heights and colour values for that height for the interpolation. |
Method Summary | |
---|---|
void |
generate(GeometryData data)
Generate a new set of colors based on the passed data. |
void |
setColorRamp(float[] heights,
javax.vecmath.Color3f[] ramp)
Set the color data for the ramp to the new 3 component values. |
void |
setColorRamp(float[] heights,
javax.vecmath.Color4f[] ramp)
Set the color data for the ramp to the new 4 component values. |
void |
setColorRamp(float[] heights,
float[][] ramp)
Set the color data for the ramp to the new 3 or 4 component values. |
void |
setColorRamp(float[] heights,
float[][] ramp,
int size)
Set the color data for the ramp to the new 3 or 4 component values. |
void |
setColorRamp(float[] heights,
float[] ramp,
boolean hasAlpha)
Set the color data for the ramp to the new 3 or 4 component values. |
void |
setColorRamp(float[] heights,
float[] ramp,
int size,
boolean hasAlpha)
Set the color data for the ramp to the new 3 or 4 component values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorRampGenerator()
public ColorRampGenerator(float[] heights, javax.vecmath.Color3f[] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic ColorRampGenerator(float[] heights, javax.vecmath.Color4f[] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic ColorRampGenerator(float[] heights, float[][] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic ColorRampGenerator(float[] heights, float[] ramp, boolean hasAlpha)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthMethod Detail |
---|
public void setColorRamp(float[] heights, javax.vecmath.Color3f[] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] heights, javax.vecmath.Color4f[] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] heights, float[][] ramp)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] heights, float[][] ramp, int size)
heights
- The array of heights for each colorramp
- The color values at each heightsize
- The number of values to read from the two inputs
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] heights, float[] ramp, boolean hasAlpha)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] heights, float[] ramp, int size, boolean hasAlpha)
heights
- The array of heights for each colorramp
- The color values at each height
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void generate(GeometryData data) throws InvalidArraySizeException
data
- The data to base the calculations on
InvalidArraySizeException
- The array is not big enough to contain
the requested colours
java.lang.IllegalArgumentException
- The vertex array is not defined
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |