FSA
Erfahrenes Mitglied
Hallo. Ich habe ein 4x4 Matrix in DirectX (row-major). Ich schreibe eine Y Rotation so hinein:
Soweit so gut. Jetzt ist aber das Problem, wenn ich die Rotation wieder auslesen will, dass ich nur Werte zwischen -PI/2 und PI bekommen. Das ist doof denn ich bekomme so nur 90°. Wie kann ich jetzt Werte zwischen 0 und 2PI auslesen? Also 0-360 Grad. Ich dachte mir einfach sin^-1() also asinf(mResult.m31), doch da bekomme ich, wie schon gesagt, nur Werte zwischen PI/2 und PI raus(0°-90°).
Danke im Voraus
C++:
// Rotationsmatrix berechnen
mResult.m12 = 0.0f; mResult.m14 = 0.0f;
mResult.m21 = 0.0f; mResult.m22 = 1.0f; mResult.m23 = 0.0f; mResult.m24 = 0.0f;
mResult.m32 = 0.0f; mResult.m34 = 0.0f;
mResult.m41 = 0.0f; mResult.m42 = 0.0f; mResult.m43 = 0.0f; mResult.m44 = 1.0f;
mResult.m11 = mResult.m33 = cosf( f );
mResult.m31 = sinf( f );
mResult.m13 = -mResult.m31;
Danke im Voraus

Zuletzt bearbeitet von einem Moderator: