Advertisement

What do gluProject and gluUnProject actually do?

Started by July 15, 2003 08:33 PM
0 comments, last by DalTXColtsFan 21 years, 7 months ago
Greetings all, I was reading up on the two functions in the subject line and slapped together a little MFC test program that''s on the site in my sig. What exactly is gluUnProject "unprojecting"? I know my mouse arithmetic isn''t perfect yet, but the numbers it''s returning don''t make any sense - they''re not affected by whether or not the mouse is actually pointing at the cube. So what exactly do these functions do and when might you want to use them? Pointers appreciated! Thanks Joe Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

I got it!!! :D

I was doing two things wrong - 1. I wasn''t using the ScreenToClient and ClientToScreen functions correctly, so my mouse coordinates were all over the place, 2. I forgot that while Windows understands mouse coordinates relative to the *upper* left corner, OpenGL understands them relative to the *lower* left corner.

I have a 10x10 rectangular prism, and now when you move the mouse over the screen you can see instantly the difference when the mouse is pointing at the prism vs. when it isn''t.

If anyone else is wondering how this function works, go ahead and check my page. MFC is required.

Cool stuff!

Thanks
Joe


Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

This topic is closed to new replies.

Advertisement