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 / August 2006

Tip: Looking for answers? Try searching our database.

Convert mouse position to Texture position on ball

Thread view: 
Starter3D - 20 Jul 2006 17:03 GMT
Hi All,

I am an experienced Java developer and since a few weeks I joined a project
which involved real time rendering of 3D objects and interaction with those
objects. I have a problem for which I hope that an experienced 3D programmer
can help me.

Usage:
* I’ve rendered an 3D Sphere object which in this case is a perfect ball (not
eggs shape) using Spherical Texture mapping.
* The idea is that a user can interact with this ball and rotate the ball.
The user clicks a location on the ball and the user is to enter a ‘dot’ on
the ball. Thereafter the user can rotate the ball and place other dots on the
ball.

Problem statement
* When a user clicks the surface of the ball our application is able to get
the mouse position (x, y) in Canvas2D.

Question: How can I convert the mouse position to the Texture position in
order to update the ball surface?

If you are able to help or if you need more information please let me know
because I am really stuck with this.

Martijn Hermanns
Paul Drallos - 06 Aug 2006 04:15 GMT
> Hi All,
>
[quoted text clipped - 22 lines]
>
> Martijn Hermanns

I've never done this, but I'm pretty sure it's possible to set up your
mouse picking so that it returns the nearest vertice of the picked
object.  That might get you pretty close (if your sphere is made of
small sections.)

Other than that, you could keep track of the sphere's rotation angles
and then work out the trigonometry for determining the point on the
sphere.


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.