diff options
| author | chriscamacho <chriscamacho@users.noreply.github.com> | 2019-08-09 16:04:52 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-08-09 17:04:52 +0200 |
| commit | 6f2f09947f5456cefb3d91d3f667f4d72fa55be6 (patch) | |
| tree | 91f053178f1c384a2c59120173dec3e71e8f28e3 /examples/models | |
| parent | e6e48675cc8c8a2a9abe7bae257054f529da419a (diff) | |
| download | raylib-6f2f09947f5456cefb3d91d3f667f4d72fa55be6.tar.gz raylib-6f2f09947f5456cefb3d91d3f667f4d72fa55be6.zip | |
addition to raylib to create matrix from 3 euler angles (#938)
Diffstat (limited to 'examples/models')
| -rw-r--r-- | examples/models/models_yaw_pitch_roll.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index 0931c00e..72529d89 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -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(); |
