diff options
| author | raysan5 <raysan5@gmail.com> | 2014-12-16 11:15:56 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2014-12-16 11:15:56 +0100 |
| commit | 2e5f58255a391323fef54afc895a1d5a8ba06344 (patch) | |
| tree | b13e79f6831a6bb8f61fc46f1c694304c6061825 /src/rlgl.c | |
| parent | cfa60ab7e6313f85594f63d2830fdc2ce19e180e (diff) | |
| download | raylib-2e5f58255a391323fef54afc895a1d5a8ba06344.tar.gz raylib-2e5f58255a391323fef54afc895a1d5a8ba06344.zip | |
Working on rotation math...
[models] Added DrawQuad()
Diffstat (limited to 'src/rlgl.c')
| -rw-r--r-- | src/rlgl.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -299,14 +299,21 @@ void rlRotatef(float angleDeg, float x, float y, float z) // TODO: Support rotation in multiple axes Matrix rot = MatrixIdentity(); + // OPTION 1: It works... if (x == 1) rot = MatrixRotateX(angleDeg*DEG2RAD); else if (y == 1) rot = MatrixRotateY(angleDeg*DEG2RAD); else if (z == 1) rot = MatrixRotateZ(angleDeg*DEG2RAD); - //Vector3 vec = (Vector3){ 0, 0, 1 }; + // OPTION 2: Requires review... + //Vector3 vec = (Vector3){ 0, 1, 0 }; //VectorNormalize(&vec); - //rot = MatrixFromAxisAngle(vec, angleDeg*DEG2RAD); // Working - + //rot = MatrixFromAxisAngle(vec, angleDeg*DEG2RAD); // Working? + + // OPTION 3: TODO: Review, it doesn't work! + //Vector3 vec = (Vector3){ x, y, z }; + //VectorNormalize(&vec); + //rot = MatrixRotate(angleDeg*vec.x, angleDeg*vec.x, angleDeg*vec.x); + MatrixTranspose(&rot); *currentMatrix = MatrixMultiply(*currentMatrix, rot); |
