Class dnx.lr.node.ElevationGridNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.ElevationGridNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.SubsidiaryNode
                           |
                           +----dnx.lr.GeometryNode
                                   |
                                   +----dnx.lr.node.ElevationGridNode

public class ElevationGridNode
extends GeometryNode
implements BoundingBoxCachingNode, ModelSource
 ElevationGrid {
    eventIn      MFFloat      set_height      
    exposedField SFNode       color           NULL
    exposedField SFNode       normal          NULL
    exposedField SFNode       texCoord        NULL
    field        MFFloat      height          []
    field        SFBool       ccw             TRUE
    field        SFBool       colorPerVertex  TRUE
    field        SFFloat      creaseAngle     0
    field        SFBool       normalPerVertex TRUE
    field        SFBool       solid           TRUE
    field        SFInt32      xDimension      0
    field        SFFloat      xSpacing        0.0
    field        SFInt32      zDimension      0
    field        SFFloat      zSpacing        0.0
 }

The ElevationGrid node specifies a uniform rectangular grid of varying height in the XZ plane of the local coordinate system. The geometry is described by a scalar array of height values that specify the height of a rectangular surface above each point of the grid.

The xDimension and zDimension fields indicate the number of dimensions of the grid height array in the X and Z directions. Both xDimension and zDimension must be > 1. The vertex locations for the rectangles are defined by the height field and the xSpacing and zSpacing fields:

Thus, the vertex corresponding to the point, P[i, j], on the grid is placed at:

     P[i,j].x = xSpacing * i
     P[i,j].y = height[ i + j * zDimension]
     P[i,j].z = zSpacing * j
     where 0<i<xDimension and 0<j<zDimension. 
 

The set_height eventIn allows the height MFFloat field to be changed to allow animated ElevationGrids.

The default texture coordinates range from [0,0] at the first vertex to [1,1] at the last vertex. The S texture coordinate will be aligned with X, and the T texture coordinate with Z.

The colorPerVertex field determines whether colors (if specified in the color field) should be applied to each vertex or each quadrilateral of the ElevationGrid. If colorPerVertex is FALSE and the color field is not NULL, then the color field must contain a Color node containing at least (xDimension-1)*(zDimension-1) colors. If colorPerVertex is TRUE and the color field is not NULL, then the color field must contain a Color node containing at least xDimension*zDimension colors.

See the "Concepts - Geometry" for a description of the ccw, solid, and creaseAngle fields.

By default, the rectangles are defined with a counterclockwise ordering, so the Y component of the normal is positive. Setting the ccw field to FALSE reverses the normal direction. Backface culling is enabled when the ccw field and the solid field are both TRUE (the default).


Variable Index

 o ccw
 o color
 o colorPerVertex
 o creaseAngle
 o height
 o normal
 o normalPerVertex
 o solid
 o texCoord
 o xDimension
 o xSpacing
 o zDimension
 o zSpacing

Constructor Index

 o ElevationGridNode()

Method Index

 o boundingBoxHasChanged(Field)
Meant to be overridden by subclasses.
 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getCachedBoundingBox()
For BoundingBoxCachingNode.
 o handleEvent(SceneEvent)
Handle an event.
 o initFields()
Initialize field values.
 o recomputeBoundingBox(BoundingBox3)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
 o render(NodeInstance, RenderTraversal)
 o sendModelData(Model)

Variables

 o color
  public SFNode color
 o normal
  public SFNode normal
 o texCoord
  public SFNode texCoord
 o height
  public MFFloat height
 o ccw
  public SFBool ccw
 o colorPerVertex
  public SFBool colorPerVertex
 o creaseAngle
  public SFFloat creaseAngle
 o normalPerVertex
  public SFBool normalPerVertex
 o solid
  public SFBool solid
 o xDimension
  public SFInt32 xDimension
 o xSpacing
  public SFFloat xSpacing
 o zDimension
  public SFInt32 zDimension
 o zSpacing
  public SFFloat zSpacing

Constructors

 o ElevationGridNode
  public ElevationGridNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o render
  public void render(NodeInstance inst,
                     RenderTraversal traversal)
Overrides:
render in class GeometryNode
 o sendModelData
  public int sendModelData(Model model)
Overrides:
sendModelData in class GeometryNode
 o getCachedBoundingBox
  public BoundingBox3 getCachedBoundingBox()
For BoundingBoxCachingNode.
 o recomputeBoundingBox
  public void recomputeBoundingBox(BoundingBox3 box)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
Overrides:
recomputeBoundingBox in class Node
 o boundingBoxHasChanged
  protected boolean boundingBoxHasChanged(Field f)
Meant to be overridden by subclasses.
Overrides:
boundingBoxHasChanged in class Node
 o handleEvent
  protected void handleEvent(SceneEvent ev)
Handle an event.
Overrides:
handleEvent in class Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index