Ok, I have my matrix and I rotate it via 3 functions. (X, Y, Z)
It will rotate it relativ NOT absolute.
My Problem is:
After each function call the scene got smaller
- the axis I rotate gets shrinked - but only this axis -
And it is very fast - after about 5 rotations it has nearly half the original size...
However the rotations seem to be correct - i think it is not a math problem -> rounding-problem ?
here one of the 3 functions
I''m running on about 3 hours of sleep here, but your function looks basically correct. The only thing I see immediately wrong is something you already recognized in your second message. You must use temporary variables when you calculate m[0], m[1], and m[2]. Reason? You need to use the original, unmodified values of m[0], m[1], and m[2] when you calculate m[8], m[9], and m[10] later on. And if you do not use temporary variables you lose the original values. Your code should look like:
new_m0 = calculate using m[] new_m1 = calculate using m[] new_m2 = calculate using m[] m[8] = calculate using m[] m[9] = calculate using m[] m[10] = calculate using m[] m[0] = new_m0 m[1] = new_m1 m[2] = new_m2
Hope that helps!
Graham Rhodes Senior Scientist Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net