Skip to main content
gamedev.net
🔒 Locked

Rotations

Started by Tagamoga Jan 5, 2003 at 7:49 AM 0 replies 400+ views
Original Post
Tagamoga
Tagamoga
Hello. I try to program rotation, that can be managed by mouse imput. Evereything works fine, when I roted only round the y-axis (horizontal mouse movement) or round the x-axis(vertical mouse movement. After I genereated each functionality for themself, I put them together so that I could rotated my face around two axis with one mousemove, but then the output is all nonsense. float laenge = m_KameraPosition.x*m_KameraPosition.x + m_KameraPosition.y*m_KameraPosition.y + m_KameraPosition.z*m_KameraPosition.z ; laenge = (float)sqrt(laenge); //This is the length of the vector, which represent the camera // this is rotation around y-axis m_KameraPosition.x = laenge * (float)sin(angleY); m_KameraPosition.z = laenge * (float)cos(angleY); // this is rotation aroun x-axis m_KameraPosition.y = laenge * (float)sin(angleX); m_KameraPosition.z = laenge * (float)cos(angleX); Can somebody eplain me, why these two part works fine when only one is used, but together my face disaper? Oh, I am porgramming in C++ and DirectX8 Taggi

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.