From cee1c87ed52e417024a1c8663784c16383d54e30 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sat, 3 Oct 2020 11:54:00 +0100 Subject: [PATCH] Fix issue with glRotate --- GL/matrix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GL/matrix.c b/GL/matrix.c index 7af666d..80e9d84 100644 --- a/GL/matrix.c +++ b/GL/matrix.c @@ -186,8 +186,9 @@ void APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { 0.0f, 0.0f, 0.0f, 1.0f }; - float r = DEG2RAD * angle; + vec3f_normalize(x, y, z); + float r = DEG2RAD * angle; float c = cos(r); float s = sin(r); float invc = 1.0f - c; @@ -198,8 +199,6 @@ void APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { float xy = y * x; float yz = y * z; - vec3f_normalize(x, y, z); - rotate[M0] = (x * x) * invc + c; rotate[M1] = xy * invc + zs; rotate[M2] = xz * invc - ys;