PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : RotationsMatrix


del_4901
2004-05-08, 03:41:41
Einer noch frisch genug mir ne 4x4 RotationsMatrix herzuleiten? :/ Ich brauch das für mein cg-Projekt.

HajottV
2004-05-08, 11:00:15
Original geschrieben von AlphaTier
Einer noch frisch genug mir ne 4x4 RotationsMatrix herzuleiten? :/ Ich brauch das für mein cg-Projekt.

Machen wir's mal um eine Achse.

| cos(a) -sin(a) 0 0 |
| sin(a) cos(a) 0 0 |
| 0 0 1 0 |
| 0 0 0 1 |

Rotationen um die anderen Achsen analog. Durch Multiplikation der Matrizen erhälst Du dann die entgültige Matrix.

Gruß

Jörg

Asmodeus
2004-05-08, 11:37:45
Komplett sieht die Sache so aus:


...
glRotate produces a rotation of angle degrees around the vector (x, y, z) . The current matrix is multiplied by a rotation matrix with the product replacing the current matrix with the following matrix as its argument:

http://www.inf.uni-konstanz.de/~colditz/matrix.jpg

Where c = cos (angle) , s = sin (angle) , and || (x, y, z) || = 1, (if not, the GL will normalize this vector).

Carsten.