Here's how I move the viewplatform:

These are defined as Class Fields:

         static TransformGroup VPTG;  // ViewPlatform Transform Group
         static Transform3D VPT3D;  // ViewPlatform Transform Group Transform3D



In your main method or whatever helper method you have to create the scene,
you will usually see something like this:

         scene = new BranchGroup();
//      SimpleUniverse is a Convenience Utility class
         SimpleUniverse simpleU = new SimpleUniverse(canvas3D);

//      This will move the ViewPlatform back a bit so the
//      objects in the scene can be viewed.
//      simpleU.getViewingPlatform().setNominalViewingTransform();


I commented out the last line because I want to implicitly set the viewer's
position.
You need to be sure that Viewplatform doesn't have more than one transform
since it is a
MultitransformGroup, so do this:

         int num =
simpleU.getViewingPlatform().getMultiTransformGroup().getNumTransforms();
         System.out.println("Number of transforms =" + num);

Provided that num = 1, then there is only one Transform and its index is 0
(array nomenclature)
So now do this:

         VPTG = new TransformGroup();

         VPTG =
simpleU.getViewingPlatform().getMultiTransformGroup().getTransformGroup(0);
  // Notice the 0

         VPT3D = new Transform3D();

//      This will move the position to Z = 30, you may want to do rotations
as well, so use the appropriate methods
         VPT3D.setTranslation(new Vector3f(0.0f, 0.0f, 30.0f));
         VPTG.setTransform(VPT3D);


That's it.  Works for me for the SimpleU.









>X-Mailer: Internet Mail Service (5.5.2650.21)
>Date:         Mon, 24 Jan 2000 11:03:20 -0500
>Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
>Sender: Discussion list for Java 3D API <[EMAIL PROTECTED]>
>From: "Heydemann, Chris" <[EMAIL PROTECTED]>
>Subject:      Re: [JAVA3D] universe bounds
>To: [EMAIL PROTECTED]
>
>Yes, but when I'm using SimpleUniverse, what are the steps to get at and
>change my View?
>
>TIA,
>Chris
>
>
> > -----Original Message-----
> > From: Mojtaba Hosseini [SMTP:[EMAIL PROTECTED]]
> > Sent: Monday, January 24, 2000 9:30 AM
> > To:   [EMAIL PROTECTED]
> > Subject:      Re: [JAVA3D] universe bounds
> >
> > Hi,:)
> >  It might be because of the bounds put on your view. Try setting the
> > FrontClipDistance of your View.
> >                                               Mojtaba
> >
> > >My universe seemms to be bounded. When an object goes further than 50
> > >units back on the z-axis, it disappears. I first thought it was a light
> > >problem, I then fixed a 1000 wide bounding sphere on my ambiant light.
> > >It does no effect.
> > >I did not manage to increase the universe bounds.
> >
> > ==========================================================================
> > =
> > 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".

***********************************************************************
Eric Reiss - http://www.sigda.acm.org/Eric/
Email: [EMAIL PROTECTED]

SIGDA Internet Server Manager - http://www.sigda.acm.org/

Assistant Systems Manager - School of Engineering
University of Pittsburgh
***********************************************************************

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