I have a layout problem when I load a 3D modelling file say OBJ file into
the Java3D program,each time, the OBJ file is generated by others and is
different. When I load them, many times the objects is not in the center of
the scene,sometimes, I can not see them at all, I have to use the code like
the following to scale it an translate it, the Vector3f(6.0f,-1.0f,-35.0f)
is the result of my adjustment,so that after my adjustment ,it  can show on
the center of the screen, not in the corner of it. Sometimes, I really have
to try many times to get these adjustment parameters.(I usually use the
following code to set the viewplatform:
SimpleUniverse u = new SimpleUniverse(c);
u.getViewingPlatform().setNominalViewingTransform(); )

  The following is the transformation I made:

        TransformGroup objScale = new TransformGroup();
        Transform3D t3d = new Transform3D();
        t3d.setScale(0.01);
        objScale.setTransform(t3d);

        Transform3D tra=new Transform3D();
        tra.setTranslation(new Vector3f(6.0f,-1.0f,-35.0f));
        TransformGroup objTra=new TransformGroup(tra);


   I have the following questions,
1) If I use above method, which transform goes first? Scale or Translation?
Does it matter?
2) How to handle above siutation properly? Is there a method that can load
the outside different modelling file each time, then can automatically put
the scene objects in the center of the screen without my manually adjustment
every time? How to do that?

    Thanks a lot.

David
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

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