The ObjectFile class' constructor may be sent the RESIZE flag: The
object's vertices will be changed so that the object is centered at
(0,0,0) and the coordinate positions are all in the range of (-1,-1,-1)
to (1,1,1).
-Paul
> X-Originating-IP: [172.131.52.124]
> Mime-Version: 1.0
> X-OriginalArrivalTime: 08 Oct 2000 21:03:08.0236 (UTC)
FILETIME=[28D010C0:01C0316B]
> Date: Sun, 8 Oct 2000 21:03:08 GMT
> From: david Xia <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Automatically adjust the scene in the center problem
> To: [EMAIL PROTECTED]
>
> 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".
===========================================================================
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".