We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › mouse picking 3D textured sphere location
Page Index Toggle Pages: 1
mouse picking 3D textured sphere location (Read 588 times)
mouse picking 3D textured sphere location
Apr 17th, 2008, 1:11pm
 
Hello Smiley

I'm a newbie in 3D and I have a problem : for a sketch, I used the opengl textured sphere example (in P3D, because of a problem with triangle_strip). I wanted a textured & movable sphere representing the earth, and that's OK.

But I need to locate where the mouse is clicking. I tried with cos but it doesn't work, because of the Y movement of the earth.

So I learned that mouse picking exists, and I found the example of tom carden with triangles (http://www.tom-carden.co.uk/p5/picking_with_projection/applet/). I think I understand a bit how it works, but with a sphere it's very different (all these triangles strangely placed in space... Smiley)
I need to know the XY position of the 2D mouse on the 3D sphere :/

Did anybody have the same problem, or knows how I can do this ?
Thank you very much !! Cheesy
Page Index Toggle Pages: 1