3d picking

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Sep 09, 2003 at 17:03

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?

6 Replies

Please log in or register to post a reply.

065f0635a4c94d685583c20132a4559d
0
Ed_Mack 101 Sep 09, 2003 at 17:43

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 \^_\^

E05263ec846eb85da803f56e2917962d
0
Noor 101 Sep 09, 2003 at 19:00

Ed Mack: welcome back…

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Sep 09, 2003 at 19:29

Yes, gl picking system is an option. But I would prefer the raytracing solution.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Sep 10, 2003 at 05:29

there is a code snipped floating around.. for ray-sphere intersections.. its the snipped we used in starcraft3d to select units.. it worked great..

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Sep 10, 2003 at 12:54

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).

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Sep 10, 2003 at 22:17