- procedure UpdateRotation(RotAxis: Integer; Ang: Single);
- var
- TmpMat : TMatrix4f;
- LocalRotAxis : TVector3f;
- begin
- //Lokale Rotations Achse berechnen
- Case RotAxis of
- ROTATE_LOCAL_X : LocalRotAxis := VectorTransform(XAxis, ObjMat);
- ROTATE_LOCAL_Y : LocalRotAxis := VectorTransform(YAxis, ObjMat);
- ROTATE_LOCAL_Z : LocalRotAxis := VectorTransform(ZAxis, ObjMat);
- end;
- // Rotations-Matrix für den Winkel ANG um die Rotations-Achse
- // erstellen.
- TmpMat := CreateRotationMatrix(LocalRotAxis, DegToRad(Ang));
- // Nun nur noch die Objekt-Matrix auf den aktuellen Stand
- // bringen (also ebenfalls um die Y-Achse drehen)
- ObjMat := MatrixMultiply(ObjMat, TmpMat);
- end;