Grouping Scene Graph Elements

So far, we have only worked with BranchGroup objects, but—as mentioned previously—six subclasses of the Group node can be used to achieve different organization/functional groupings. We examine these other subclasses of Group here.

TransformGroup

Although the TransformGroup is not listed among the mandatory objects in any Java 3D program, it is effectively mandatory in the sense that spatial transformation is at the heart of 3D graphics, and TransformGroups are the mechanism by which spatial transformations are made in Java 3D.

If we wanted to add a second box to our simple scene in Listing 11.1, we could add the following lines to the createScene() method:

 Public BranchGroup createScene() { . . . // Make a second ...

Get Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.