LWJGL
May 17, 2012, 03:01:09 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: 27 Cubes meet Mouse X and Ys, kinda?  (Read 2473 times)
JediSange
Newbie
*
Posts: 6


« on: November 21, 2005, 08:31:03 »

Well, basically I'm working on something that rotates 27 cubes around the screen.  When I right click the mouse rotation is haulted and the player can click to place a marker on the cube.  The problem is that I have no earthly idea how to translate the 3D Float points to something I can compare the X and Y with... any ideas?
Logged
CaseyB
Talks Too Much
***
Posts: 118



« Reply #1 on: November 21, 2005, 10:38:20 »

You can either use picking, or gluProject/gluUnProject.  That's as much as I know, unfortunately!  I need to do the same kind of thing and haven't been able to get it working!
Logged
napier
Talks Too Much
***
Posts: 104


WWW
« Reply #2 on: November 22, 2005, 07:37:48 »

Here's a simple demo that does screen/world translations:

   http://potatoland.com/code/gl/lwjgl_demoScene.zip

In GLApp_DemoScene.java, the functions mouseMove() and mouseDown() translate screen coords to world.

I wrap the gluUnproject calls in a base class function called getWorldCoordsAtScreen(), which may be helpful or annoying depending on how you like to code ;-)
Logged

penGL/Java/LWJGL demos and code: http://potatoland.org/code/gl
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!