You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to GameD...@googlegroups.com
I should have waited to talk about shared groups until after I had a sample. Here is a sample you can use.
Wood
for (i=0;i<copies_to_add;i++) { // the position where this copy will be placed in the scene tilex = i*posx; tilez = i*posz;
// create a transform for the leaf copy v3fTmp.set(tilex,0.0f,tilez); t3dTmp.set(v3fTmp); TransformGroup tg = new TransformGroup(t3dTmp);
// create the main instance if it has not already been created // all leaf nodes will to refer to this branch group if (sharedItem==null) {
// get the branch group from the model // since it is shared, this can never be added to a real scene // changes to this will be reflected in all the copies BranchGroup bg = sceneModel.getSceneGroup();
// create the shared group
sharedItem = new SharedGroup();
// add the model to this SharedGroup sharedItem.addChild(bg);
// compile it before referencing it sharedItem.compile(); }
// create the leaf node with a reference to the shared group Link leaf = new Link(sharedItem);
// add the leaf to this copies transform group tg.addChild(leaf);
// add the transform group to the overall model bgParent.addChild(tg); } // for