In case there are several Shape3Ds in your branchgroup you'll actually have several geometries... A call to shape3d.getGeometry() will reveal each one.
Call something like following method with your branchgroup in order to get a list of all your Shape3Ds inside it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public List getShape3Ds(Node node) { List shapelist = new ArrayList(); addChildsToList(node, shapeliste); return shapelist; }
private void addChildsToList(Node node, List addlist) { if (node instanceof Shape3D) { addlist.add(node); } else if (node instanceof Group) { Group group = (Group) node; List childlist = group.getChildren(); for (Iterator n = childlist.iterator(); n.hasNext(); ) { node = (Node) n.next(); addChildsToList(node, addlist); } } } |