AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to grip and move the object with mouse

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
aleksandar
Guest





PostPosted: Thu Apr 20, 2006 9:12 am    Post subject: How to grip and move the object with mouse Reply with quote



hi all,

i need help (as everyone else) Smile)

I'm trying to do the following.
whan i'm over some object and i press mouse button, after which i'm
doing the drag, i want that when mouse is moved the object also moves
but in such manner that the gripped point(on object)i s laways under
mouse pointer.

thanks
Back to top
Ced
Guest





PostPosted: Thu Apr 20, 2006 12:12 pm    Post subject: Re: How to grip and move the object with mouse Reply with quote



(sorry I can't speek english very well)

It's very easy, Java3D already have what you need. Take a look at
MouseTranslate in the javadoc.

All you have to write is something like that :
MouseBehavior mouseTranslate = new MouseTranslate(this.mouseTransform);
this.mouseTransform.addChild(mouseTranslate);
mouseTranslate.setSchedulingBounds(schedulingBounds);

Don't forget to put the visual objects you want to move while your
mouse drag in the TransformGroup "mouseTranslate".

I hope my explanations are clear enough for you to understand :)

Take a look at the other MouseBehaviors : MouseRotate and MouseZoom,
they are also interresting. Do not use MouseZoom when you work with
parrallel projection.
Back to top
Ced
Guest





PostPosted: Fri Apr 21, 2006 8:12 am    Post subject: Re: How to grip and move the object with mouse Reply with quote



Ah, and use the right mouse button Smile
Back to top
aleksandar
Guest





PostPosted: Fri Apr 21, 2006 12:12 pm    Post subject: Re: How to grip and move the object with mouse Reply with quote

HI,

I'm very glad that someone has responded.

Unfortunately MouseTranslate behavior is not what I had in mid. I have
tried with it in first place.

When the button is pressed over visual object and mouse is dragged the
selected object follows mouse movements and that is OK.
But I also want that during the drag, object lies under mouse cursor -
so that it seems that i have grabbed a point on that object and that
point acts like a handle for moving.

thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.