< Zurück | Inhalt | Weiter >

From NodesTest.java


//create the SharedGroup

SharedGroup sharedGroup1 = new SharedGroup();


//add geometry to the SharedGroup sharedGroup1.addChild

( createLabel( "4. Shared Group 1", labelScale ) );


//add the first Link for the SharedGroup switchGroup.addChild( new Link( sharedGroup1 ) );


//add the second Link for the SharedGroup switchGroup.addChild( new Link( sharedGroup1 ) );


//Note. The InterpolatorTest example also uses SharedGroups

//and Link Nodes in a more substantial manner.


image

SharedGroups can be very useful in minimizing the memory footprint of an application because a single SharedGroup can be referenced hundreds of times within a scenegraph to position repeating geometry within a scene.