addition to raylib to create matrix from 3 euler angles (#938)
This commit is contained in:
parent
e6e48675cc
commit
6f2f09947f
2 changed files with 34 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue