|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node | +--javax.media.j3d.Group | +--javax.media.j3d.BranchGroup | +--LODSegment
LOD segment is based on a TransformGroup. Each LODSegment is actually comprised of three ElevationSegments, each created with a different resolution. Switch and DistanceLOD objects are used to determine which of the three to render (based on how far away it is from the viewing platform). This speeds up rendering and allows real-time fly throughs of the scene.
Field Summary | |
private float[] |
distances
distance array used to determine which ElevationSegment to display. |
private javax.media.j3d.DistanceLOD |
dLOD
DistanceLOD node to tell Switch which one to display |
GroundCoordinates |
groundCoordinates
Ground coordinates, lat, long, of the segment |
private int[] |
resolutions
resolutions of Elevation segments, 1 implies every point, 10 implies every 10th point |
private ElevationSegment[] |
segments
ElevationSegments, one for each resolution |
private javax.media.j3d.Switch |
switchNode
Switch node to control ElevationSegments |
Fields inherited from class javax.media.j3d.BranchGroup |
ALLOW_DETACH |
Fields inherited from class javax.media.j3d.Group |
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Fields inherited from class javax.media.j3d.SceneGraphObject |
|
Constructor Summary | |
LODSegment(int[][] elevations,
int startRow,
int startColumn,
int stopRow,
int stopColumn,
int minEl,
int maxEl,
GroundCoordinates gc,
float exageration,
float minX,
float maxX,
float minZ,
float maxZ)
Constructor is for creating the series of objects that allow level of detail based on distance displays. |
Method Summary | |
float |
getElevationAt(float x,
float z)
Fetches the elevation at a particular location on the terrain map given the x,z coordinates. |
ElevationSegment |
getSegment(int i)
retrieves an elevation segment object |
void |
stitchRight(LODSegment other)
stitch right of this segment to left of other segment, stitching consists of averaging the normals on the common boundary vertices between segments. |
void |
stitchTop(LODSegment other)
stitch top of this segment to bottom of other segment, stitching consists of averaging the normals on the common boundary vertices between segments. |
Methods inherited from class javax.media.j3d.BranchGroup |
cloneNode, compile, detach, pickAll, pickAllSorted, pickAny, pickClosest |
Methods inherited from class javax.media.j3d.Group |
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, insertChild, moveTo, numChildren, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds |
Methods inherited from class javax.media.j3d.Node |
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData, updateNodeReferences |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public GroundCoordinates groundCoordinates
private int[] resolutions
private float[] distances
private ElevationSegment[] segments
private javax.media.j3d.Switch switchNode
private javax.media.j3d.DistanceLOD dLOD
Constructor Detail |
public LODSegment(int[][] elevations, int startRow, int startColumn, int stopRow, int stopColumn, int minEl, int maxEl, GroundCoordinates gc, float exageration, float minX, float maxX, float minZ, float maxZ)
elevations
- two dimensional array of terrain elevation data in metersstartRow
- first row of data to use from elevationsstartColumn
- first column of data to use from elevationsstopRow
- last row of data to use from elevationsstopColumn
- last column of data to use from elevationsminEl
- minimum elevation in elevationsmaxEl
- maximum elevation in elevationsgc
- latitude, longitude of the corners of this segmentexageration
- amount to exagerate(multiply) elevations byminX
- starting x coordinate in metersmaxX
- stopping x coordinate in metersminZ
- starting z coordinate in metersmaxZ
- stopping z coordinate in metersMethod Detail |
public ElevationSegment getSegment(int i)
i
- index of the segment desired
public void stitchRight(LODSegment other)
other
- reference to the segment to the right of this onepublic void stitchTop(LODSegment other)
other
- reference to the segment to the right of this onepublic float getElevationAt(float x, float z)
x
- x coordinatez
- z coordinate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |