< Zurück | Inhalt | Weiter >

5.10 TransformGroup

java.lang.Object

|

+−−javax.media.j3d.SceneGraphObject

|

+−−javax.media.j3d.Node

|

+−−javax.media.j3d.Group

|

+−−javax.media.j3d.TransformGroup


The TransformGroup Node is central to almost all scenegraph designs. A TransformGroup incorporates the rotation, translation, and scaling information that is applied to all of its child Nodes. Without the TransformGroup, scenegraphs would be static, always positioned at 0,0,0, uniformly unit scaled, and without rotation about any of the axes. Not a very interesting interactive scene.


The TranformGroup controls orientation of its child Nodes through the Transform3D object that it encapsulates (figure 5.5). The Transform3D object represents such transformations using a typical 4 ×4 transformation matrix. The 4 ×4 matrix of double precision numbers allows scaling, rotation, and translation information to be stored and applied by a single matrix.


image

Figure 5.5 A TransformGroup is used to rotate a ColorCube and Text2D label to a desired orientation


A detailed understanding of the mathematics behind the Transform3D object is very useful, but is beyond the scope of this book. Some useful references for mathematics for 3D graphics are presented in appendix B. Transform3D includes methods that allow application developers to apply transformations while remaining largely ignorant of the underlying implementation.