Last thing first. Feel free to use and/or modify to your hearts content.
I don't think it is a bug in that they didn't provide a method to
orbit. They may have left it to the programmer to do. I do think that ALL
of the Mouse Behavior classes are in error in that they don't take the
viewplatform's rotations into consideration. Unless you are normal to the
XY plane, the objects don't interact intuitively with mouse
manipulations. That is why I modified them and have them accounting for
the viewer's rotations. This necessitates telling the behaviors the
viewplatform's TransformGroup. You could just pass in the Transform3D but
i did the Group.
As for the lookAt() method, I am not sure, I have never used it. It
probably provides functionality that I found other ways to implement. I
wasn't aware of it until i saw a post to the list about it and thought it
might have been useful for something I already have finished.
As far as remapping the buttons, this has been visited many time. Sun may
have even decided to allow the user to map the buttons without editing the
classes in the new set of Behaviors but I'm not sure about this.
To remap them, look at the top of the three Sun classes that I
changed. Specifically, I would start with the MouseRotate.java file. It
describes how to change the "!" in front of certain MouseEvent checks in
the processStimulus() mthod of each class.
I think you can figure it out by comparing the mouse behaviors and looking
at the "!"s.
At 07:58 PM 09/27/2000 -0700, you wrote:
>Hi Eric..
> Thanx a lot... U are prefectly right when u said that what i need
> is the
>ORBIT behavior with object always WITHIN scope. I knew what i wanted but
>really
>didn't know how to do it.. I suppose this is because I didn't properly
>investigate
>the classes written by you .
> Anyway I have further queries.
>
>1. Which fields in the classes written by you should be modified by remap
>the mouse
>buttons to the actions.!!
>2. Is it a bug of java 3d that it hasn't provided any class similar to
>MouseOrbit.? Can we get the same effect by using lookAt() method in
>MouseRotate.?
>3. Can i use ur java classes in my project?
>
>Thanx a lot.
>Ashish
>
>Eric Reiss wrote:
>
> > I have modified your code. I hope the attached files don't get confused
> > since they have the same names.
> >
> > I believe what you wanted was the Orbit behavior, not the rotate.
> > You seem a little confused about the difference.
> >
> > If you attach a rotate to an object, it will rotate. If you attach a
> > rotate to the viewplatform, it will rotate like when you sit in a spinning
> > office chair. This is what you did and it was working correctly but not
> > what you were expecting.
> >
> > I think you want to rotate around the object which is called orbiting. The
> > object is like the sun and you want to be a planet orbiting the sun and
> > always facing it.
> >
> > In the modified version of your example, since you only have one object in
> > the scene, it appears that the object is rotating, but trust me, it is the
> > viewplatform rotating around the object.
> >
> > I would also be careful about how you attach things to different branches.
> > Organization is key.
> >
> > And try to keep the post within the mailing list so others can benefit.
> >
> > >Date: Tue, 26 Sep 2000 11:15:52 -0700
> > >From: Ashish Tayal <[EMAIL PROTECTED]>
> > >X-Mailer: Mozilla 4.7 [en] (WinNT; I)
> > >X-Accept-Language: en
> > >To: Eric Reiss <[EMAIL PROTECTED]>
> > >Subject: Re: Fwd: Re: [JAVA3D] View Rotation
> > >
> > >Eric ,
> > > I am attaching a simple code which uses your class MouseRotate.
> > > Just observe
> > >the behavior..
> > >Ashish T
> > >
> > >Eric Reiss wrote:
> > >
> > > > I posted a message to the list last night with a pointer to the web
> pages I
> > > > was working on.
> > > >
> > > > >X-Mailer: Mozilla 4.7 [en] (WinNT; I)
> > > > >X-Accept-Language: en
> > > > >Date: Mon, 25 Sep 2000 11:53:58 -0700
> > > > >Reply-To: Discussion list for Java 3D API
> <[EMAIL PROTECTED]>
> > > > >Sender: Discussion list for Java 3D API <[EMAIL PROTECTED]>
> > > > >From: Ashish Tayal <[EMAIL PROTECTED]>
> > > > >Subject: Re: [JAVA3D] View Rotation
> > > > >To: [EMAIL PROTECTED]
> > > > >
> > > > >Hello..
> > > > > I guess my problem is the same. I am attaching the the MouseRotate
> > > > > Behavior on
> > > > >the viewplatform. My object is at origin and ViewPlatform at
> > > > >(0,0,2.41). Now
> > > > >when i try to rotate the object, the object goes out of scope. MY
> > > > >conclusion is
> > > > >that the Viewplatform rotates around itself rather than the
> object( which
> > > > >is at
> > > > >0,0,0).
> > > > >I haven't yet tried the lookAt() method.. But the modified clases
> of the
> > > > >mouseRotate will be most welcome... ERIC are u there?:)
> > > > >Ashish
> > > > >
> >
>
>===========================================================================
>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".