|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
gov.nasa.worldwind.layers.SkyGradientLayer
public class SkyGradientLayer
Renders an atmosphere around the globe and a sky dome at low altitude.
Note : based on a spherical globe.
Issue : Ellipsoidal globe doesnt match the spherical atmosphere everywhere.
| Field Summary | |
|---|---|
protected int |
glListId
|
protected float[] |
horizonColor
|
protected double |
lastRebuildHorizon
|
protected static int |
SLICES
|
protected static int |
STACKS
|
protected double |
thickness
|
protected float[] |
zenithColor
|
| Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
changeSupport |
| Constructor Summary | |
|---|---|
SkyGradientLayer()
Renders an atmosphere around the globe |
|
| Method Summary | |
|---|---|
protected void |
applyDrawProjection(DrawContext dc)
|
protected void |
applyDrawTransform(DrawContext dc)
|
protected static Vec4 |
CartesianToSpherical(double x,
double y,
double z)
Converts position in cartesian coordinates (XYZ) to spherical (radius, lat, lon) coordinates. |
void |
dispose()
|
void |
doRender(DrawContext dc)
|
protected void |
drawSkyDome(DrawContext dc,
float radius,
double startLat,
double endLat,
int slices,
int stacks,
float zenithOpacity,
float gradientBias)
Draws the sky dome |
double |
getAtmosphereThickness()
Get the atmosphere thickness in meter |
java.awt.Color |
getHorizonColor()
Get the horizon color |
java.awt.Color |
getZenithColor()
Get the zenith color |
protected boolean |
isValid(DrawContext dc)
|
protected void |
makeSkyDome(DrawContext dc,
float radius,
double startLat,
double endLat,
int slices,
int stacks,
float zenithOpacity,
float gradientBias)
Build sky dome and draw into the glList |
void |
setAtmosphereThickness(double thickness)
Set the atmosphere thickness in meter |
void |
setHorizonColor(java.awt.Color color)
Set the horizon color |
void |
setZenithColor(java.awt.Color color)
Set the zenith color |
protected static Vec4 |
SphericalToCartesian(double latitude,
double longitude,
double radius)
Converts position in spherical coordinates (lat/lon/altitude) to cartesian (XYZ) coordinates. |
java.lang.String |
toString()
|
protected void |
updateSkyDone(DrawContext dc)
|
| Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer |
|---|
doPick, doPreRender, getDataFileStore, getExpiryTime, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit |
| Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
|---|
propertyChange |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from interface java.beans.PropertyChangeListener |
|---|
propertyChange |
| Field Detail |
|---|
protected int glListId
protected float[] horizonColor
protected double lastRebuildHorizon
protected static final int SLICES
protected static final int STACKS
protected double thickness
protected float[] zenithColor
| Constructor Detail |
|---|
public SkyGradientLayer()
| Method Detail |
|---|
protected void applyDrawProjection(DrawContext dc)
protected void applyDrawTransform(DrawContext dc)
protected static Vec4 CartesianToSpherical(double x,
double y,
double z)
x - X coordinatey - Y coordinatez - Z coordinate
Vec4 point for the spherical coordinates {radius, lat, lon}public void dispose()
dispose in interface Disposabledispose in class AbstractLayerpublic void doRender(DrawContext dc)
doRender in class AbstractLayer
protected void drawSkyDome(DrawContext dc,
float radius,
double startLat,
double endLat,
int slices,
int stacks,
float zenithOpacity,
float gradientBias)
dc - the current DrawContextradius - the sky dome radiusstartLat - the horizon latitudeendLat - the zenith latitudeslices - the number of slices - vertical divisionsstacks - the nuber os stacks - horizontal divisionszenithOpacity - the sky opacity at zenithgradientBias - determines how fast the sky goes from the horizon color to the zenith color.
A value of 1 with produce a balanced gradient, a value greater then 1 will have
the zenith color dominate and a value less then 1 will have the opposite effect.public double getAtmosphereThickness()
public java.awt.Color getHorizonColor()
public java.awt.Color getZenithColor()
protected boolean isValid(DrawContext dc)
protected void makeSkyDome(DrawContext dc,
float radius,
double startLat,
double endLat,
int slices,
int stacks,
float zenithOpacity,
float gradientBias)
dc - the current DrawContextradius - the sky dome radius in meters.startLat - the horizon latitude in decimal degrees.endLat - the zenith latitude in decimal degrees.slices - the number of longitude divisions used for the dome geometry.stacks - the number of latitude divisions used for the dome geometry.zenithOpacity - the sky opacity at zenithgradientBias - determines how fast the sky goes from the horizon color to the zenith color.
A value of 1 with produce a balanced gradient, a value greater then 1 will have
the zenith color dominate and a value less then 1 will have the opposite effect.public void setAtmosphereThickness(double thickness)
thickness - the atmosphere thickness in meterpublic void setHorizonColor(java.awt.Color color)
color - the horizon colorpublic void setZenithColor(java.awt.Color color)
color - the zenith color
protected static Vec4 SphericalToCartesian(double latitude,
double longitude,
double radius)
latitude - Latitude in decimal degreeslongitude - Longitude in decimal degreesradius - Radius
public java.lang.String toString()
toString in class AbstractLayerprotected void updateSkyDone(DrawContext dc)
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||