Hi,
First, sorry for yet another post on rotating quad. I read so many posts here on rotation that I feel silly posting on this subject again.
The problem is that I can successfully rotate my texture, but when I do, my mouse coordinate get rotated too. Here's a snippet from my render function:
Gl.glBindTexture(Gl.GL_TEXTURE_2D, (uint)m_TextureId);
Gl.glPushMatrix();
Gl.glLoadIdentity();
Gl.glRotatef(45.0f, 0.0f, 0.0f, 1.0f);
Gl.glBegin(Gl.GL_QUADS);
//... <snip>
Gl.glEnd();
Gl.glPopMatrix(); // <-- I thought this would do it, but I was wrong
Gl.glLoadIdentity();
Gl.glMatrixMode(Gl.GL_MODELVIEW);
The above code rotates my texture 45 degrees, but when I move the mouse up and down, it also moves at 45 degrees. I'm in simple 2D, this is a snippet of my Init function, when setting up my window:
Glut.glutMotionFunc(new Glut.MotionCallback(MouseMove));
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
Gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
Gl.glViewport(0, 0, 800, 600);
Gl.glMatrixMode(Gl.GL_PROJECTION);
Gl.glLoadIdentity();
Gl.glOrtho(0, 800, 600, 0, -1, 1);
Gl.glMatrixMode(Gl.GL_MODELVIEW);
Gl.glDisable(Gl.GL_DEPTH_TEST);
Gl.glLoadIdentity();
I feel I'm RTFM'ed all out, which is why I'm resorting to posting here. I suspect the solution is a one-liner in the render function, but for the life of me I can't figure it out.