Original Post
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