Ok, I am using Win32 and programming in C++, no other API’s like GLUT/SDL is being used, only OpenGL and Win32 programming.
I am having a bit difficult time trying to sort out this problem, I am just learning Algebra basic, its not like I am in middle school, its just I was never thought how too do Algebra in my life…
What I am doing is trying to rotate a model too the position of the mouse cursor on the window.
What I have now is, that the model rotates back and forth 180 degrees when the mouse moves around it. So what I am thinking is that I mite be missing a ‘projection’ value from converting 3D cords to 2D.
This is my code:
POINT mousePosition; GetCursorPos(&mousePosition); float rotate = abs((GLfloat)atan2((float)mousePosition.y-((float)m_iHeight/2),(float)mousePosition.x-((float)m_iWidth/2)))/Math::PI*180.0f; //ROTATE TO MOUSE m_Player.SetRotation(rotate);
BTW Just a quick question about OpenGL and DirectX, I heard it’s bad to mix DirectX and OpenGL together, forgot why, but I was wondering if someone can tell me that it is or not. I just want to use DirectInput for OpenGL too use a Xbox controller.