aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2014-12-16 11:15:56 +0100
committerraysan5 <raysan5@gmail.com>2014-12-16 11:15:56 +0100
commit2e5f58255a391323fef54afc895a1d5a8ba06344 (patch)
treeb13e79f6831a6bb8f61fc46f1c694304c6061825 /src/rlgl.c
parentcfa60ab7e6313f85594f63d2830fdc2ce19e180e (diff)
downloadraylib-2e5f58255a391323fef54afc895a1d5a8ba06344.tar.gz
raylib-2e5f58255a391323fef54afc895a1d5a8ba06344.zip
Working on rotation math...
[models] Added DrawQuad()
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index ddd55a2d..43052237 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -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);