mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
addition to raylib to create matrix from 3 euler angles (#938)
This commit is contained in:
@ -92,6 +92,7 @@ int main(void)
|
||||
while (pitchOffset < -180) pitchOffset += 360;
|
||||
pitchOffset *= 10;
|
||||
|
||||
/* matrix transform done with multiplication to combine rotations
|
||||
Matrix transform = MatrixIdentity();
|
||||
|
||||
transform = MatrixMultiply(transform, MatrixRotateZ(DEG2RAD*roll));
|
||||
@ -99,8 +100,11 @@ int main(void)
|
||||
transform = MatrixMultiply(transform, MatrixRotateY(DEG2RAD*yaw));
|
||||
|
||||
model.transform = transform;
|
||||
//----------------------------------------------------------------------------------
|
||||
*/
|
||||
// matrix created from multiple axes at once
|
||||
model.transform = MatrixRotateXYZ((Vector3){DEG2RAD*pitch,DEG2RAD*yaw,DEG2RAD*roll});
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
Reference in New Issue
Block a user