Thanks J.D.
I now did it with a type of recursion. The Source is shown as followed. My
last Question: Did this really find all Shape3D's? It takes the root -
BranchGroup and follows the tree down if it found another BranchGroup or a
TransformGroup.
Or is there a better solution?
Thanks in advance...
Dominik
Method 'search' is called like this:
enum=root.getAllChildren();
shap=this.search(enum);
where 'shap' is a Vector and 'enum' a Enumeration of course....
public Vector search (Enumeration e)
{
while(e.hasMoreElements()){
Object o = e.nextElement();
System.out.println("DEBUG:"+o.toString());
if (o instanceof Shape3D){
System.out.println("Found Shape3D!");
s.addElement((Shape3D)o);
}
if (o instanceof BranchGroup) {
BranchGroup p = (BranchGroup) o;
System.out.println("BranchGroup detected with
childs:"+p.numChildren());
this.search(p.getAllChildren());
}
if (o instanceof TransformGroup) {
TransformGroup a = (TransformGroup) o;
System.out.println("TransformGroup detected with
childs:"+a.numChildren());
this.search(a.getAllChildren());
}
}
return s;
}
>Hi Dominik
>
>> the Appearance of the loaded Objects but I've no idea how to do this.
>> How can i get the Shape3D Objects from the BranchGroup or the Scene, and
>> how can I set it's Appearance??
>Well you have to traverse through the BranchGroup until you hit a Shape3D,
t>hen you can get the Appearance not from it and change it. But you should
>do this before you compile your scene. Or you have to traverse it first
>and set all the capabilites to make a traversal afterwards possible.
>That's it, quite easy isn't it!
>
>EOF,
>J.D.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".