< Zurück | Inhalt | Weiter >

5.7 OrderedGroup

java.lang.Object

|

+−−javax.media.j3d.SceneGraphObject

|

+−−javax.media.j3d.Node

|

+−−javax.media.j3d.Group

|

+−−javax.media.j3d.OrderedGroup


The OrderedGroup Node is a less commonly used scenegraph element. It allows an application developer to have basic control over the rendering order of the children of a Group Node.

An OrderedGroup (or DecalGroup which is derived from OrderedGroup) can be useful for defining the rendering order for essentially coplanar surfaces, such as a road lying on terrain, or a cloth covering a table (figure 5.3). Note that both of these examples make implicit assumptions about the range of possible viewing angles for the objects, if the viewer can sit underneath the table, the tablecloth should not be rendered before the table! Other uses for an OrderedGroup might be to implement signs or labels for geometric objects—the labels should always be rendered on top of the objects they are labeling, irrespective of the viewer’s position.


image


Figure 5.3 The effect of rendering three coplanar child Nodes using an OrderedGroup. The item at index 0 (a Text2D object with the text “3. OrderedGroup”), overlaps the item at index 1 (Child 1), which overlaps the item at index 2 (Child 2)


 

From NodesTest.java