Hi,
Thank you very much for your help (again) but there is
something I really don't understand.

I just want to get the coords of the objects I have
loaded from a .obj file
These objects are addchilded() to the scene, then to
the branch group.

>scene = ObjectFile.load(filename);
...
>branchgroup.addChild(scene.getSceneGroup());

Then I recover my objects with

>Hashtable objs= new Hashtable();
>objs= scene.getNamedObjects();

and transform them with

>Set keys = objs.keySet();
>Iterator ite = keys.iterator();
>while (ite.hasNext()){
>     Object obj3d = ite.next();
>     Shape3D node = (Shape3D) objs.get(obj3d);
>
node.setCapability(javax.media.j3d.Node.ALLOW_LOCAL_TO_VWORLD_READ);

>     //relooking
>     if (node != null) {
>         node.setAppearance(app0);
>     }

this work fine so my objects seems to be in a live
scene graph (they are rendered!).

The problem is I can't have these coord with
>      Transform3D t3d3 = new Transform3D();
>       try{
>            node.getLocalToVworld(t3d3);
>        }
>         catch(RestrictedAccessException e){}
>}

(it returns
"javax.media.j3d.RestrictedAccessException: Node:
local to vworld transform is undefined for a node that
is not part of a live scene graph")


I tried to get the coords once the branchgroup has
been added to the unverse. I have then (0.0,0.0,0.0)
coords for all my objects (egad!)

Can you help me?

Thorsten.




> > Here, you new a Shape3D, but you haven't
> > addChilded() it to
> > anything attached to the root yet.  There's no
> > getLocalToVworld() defined.
> >
> > Are you trying to setAppearance() based on the
> > Shape3D's global
> > position?  If so, you have to wait until after
> > you've attached
> > the Shape3D to the live scene graph (after a
> > setCapability(ALLOW_APPEARANCE_WRITE)).
> >
> > . . .
> >
> > Hth,
> > Fred Klingener
> >
> >


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
Yahoo! Courrier : http://courrier.yahoo.fr

===========================================================================
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".

Reply via email to