Hey Guys,
I am having trouble getting something working in a 2D Map Editor I am doing for my lab class, I am using Win32 and OpenGL.
What I am trying to accomplish is to display the mouse coordinates for where it is on the map, the map has it's 0,0 point directly at the identity matrix and it then extends towards the top and the right of the screen.
I have used a GLU function called gluUnProject , which says it takes mouse coordinates and converts them into object coordinates. The function gives me 0,0 directly in the center of the screen (which is in a dialog box by the way), and does not change when translating the camera coordinates against the model/view matrix. The desired effect is no matter where the camera is moved or zoomed, (0,0) should be the bottom left corner of the map and the map width and height should be the top right.
Any thoughts as to something I am missing? I tried multiplying the vector that gluUnProject produced by the inverse of the modelview matrix and still nothing.
I am having trouble getting something working in a 2D Map Editor I am doing for my lab class, I am using Win32 and OpenGL.
What I am trying to accomplish is to display the mouse coordinates for where it is on the map, the map has it's 0,0 point directly at the identity matrix and it then extends towards the top and the right of the screen.
I have used a GLU function called gluUnProject , which says it takes mouse coordinates and converts them into object coordinates. The function gives me 0,0 directly in the center of the screen (which is in a dialog box by the way), and does not change when translating the camera coordinates against the model/view matrix. The desired effect is no matter where the camera is moved or zoomed, (0,0) should be the bottom left corner of the map and the map width and height should be the top right.
Any thoughts as to something I am missing? I tried multiplying the vector that gluUnProject produced by the inverse of the modelview matrix and still nothing.
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz