PDA

View Full Version : 3d picking


rogerdv
09-09-2003, 11:03 AM
I finished my simple isometric renderer (looks like Neverwinter view, really nice), but I still have a couple of problems. One is convrting mouse coordinates (2d screen coords) to my map coordinates. That requires some raytracing and calculation, because the view can be rotated and zoomed. Im looking for somebody with good math skills and opengl experience who can help me to implement this. Any volunteer?

Ed Mack
09-09-2003, 11:43 AM
Ok, this isn't quite what you want I think, but you could use glRenderMode(GL_SELECT), and then set up some buffers to get the objects the mouse was over. The Red Book has a good bit of info on this I'm quite sure.

Of course, I suppose you want coords of the mouse in your virtual world ^_^

Noor
09-09-2003, 01:00 PM
Ed Mack: welcome back...

rogerdv
09-09-2003, 01:29 PM
Yes, gl picking system is an option. But I would prefer the raytracing solution.

davepermen
09-09-2003, 11:29 PM
there is a code snipped floating around.. for ray-sphere intersections.. its the snipped we used in starcraft3d to select units.. it worked great..

rogerdv
09-10-2003, 06:54 AM
Where is that code snippet?
After carefully evaluating gl picking, I found that raytracing is the only choice. Just the map tiles overflow the name buffer (I render no less than 256 tiles).

davepermen
09-10-2003, 04:17 PM
Algorithms & Code Snippets (http://www.devmaster.net/forums/index.php?showforum=35)?

(there (http://www.devmaster.net/forums/index.php?showtopic=413))