Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / February 2008

Tip: Looking for answers? Try searching our database.

Implementing direct mouse dragging

Thread view: 
Sebastian Paul - 21 Dec 2007 11:04 GMT
Hi,
I am searching for a solution that allows dragging/moving/translate
objects *directly* with the mouse. Direct means, the objects moves
exactly with the cursor.

sun.j3d.utils.behaviors.mouse.MouseTranslate implements such a
behavior, but the object is just translated into the direction of the
mouse movement, with a constant factor. The higher the factor, the
higher the translation.
I could somehow calculate the factor so that the translation
synchronizes with the mouse cursor. I think this may only work with
parallel projection, but that would be fine for me. But I have no idea
how to determine the correct factor.

Another way would be an own implementation, but that goes a little far
beyond my knowledge.
I had to create a ray from the mouse cursor on the projection plane,
and calculate a transform so that the picked point of the current node
lies on that ray.
Sounds complicated for me... Can anyone give some hints?

Kind regards, Sebastian
Alexander Gran - 04 Jan 2008 22:43 GMT
Sebastian Paul schrieb:

> Sounds complicated for me... Can anyone give some hints?

To me too. But I'm searching for the very same thing. So if you've found
something, let us know.

regards
Alex

Signature

Some operating systems are called `user friendly',
       Linux however is `expert friendly'.
Encrypted Mails welcome. Send spam to toZodiac@gmx.net, please.
PGP-Key at http://www.grans.eu/misc/pgpkey.asc | Key-ID: 0x6D7DD291

Miss Elaine Eos - 10 Jan 2008 06:13 GMT
In article
<7bc88e7f-fc92-4218-873f-0874643fced5@18g2000hsf.googlegroups.com>,
> I could somehow calculate the factor so that the translation
> synchronizes with the mouse cursor.

This is the "correct" solution, and the whole reason the factor exists.  
Obviously, if you scale the image or change view parameters, you need a
different factor.

Btw, you can calculate the factor for orthographic projection, but you'd
need to do some trig -- it's similar to when the view params change or
the image scales, but you have to update it "live."

Signature

Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.

Sebastian Paul - 05 Feb 2008 15:11 GMT
This approach sounds promising:
http://forums.java.net/jive/thread.jspa?messageID=239358&#239446


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.