Mouse coords in OGL

Started by
0 comments, last by caffeineaddict 22 years, 5 months ago
Hi, I have been working in OpenGL for a while now but i''ve only been making demos, nothing much interactive, now i''m working on a game and I need to know how to use the mouse coordinates in OpenGl, this is difficult because of the layout of the world being 3d and the mouse coords being 2d, I remember I saw an article a few weeks back somewhere, but for the life of me I can''t find it again, if anyone knows the article i''m talking about or another article of the same type, please post it, thanks a lot.
Advertisement
I don't know the article you are talking about, but I can tell sth. basic. You can't exactly know where the mouse is, because you have projected a 3D space on a 2D plane, so every point on the plane corresponds to an infinite number of points in the 3D Space. But there are some ways to implement e.g. object picking. There you can pick the object with the mouse from the screen, OpenGL even offers support for this. Look at NeHes OpenGL and game programming Tuts, somewhere there is one about this topic.



Greetings Ben

Edited by - Ben_ on November 3, 2001 5:14:17 AM

This topic is closed to new replies.

Advertisement