From 64b76bd085106fa34ccb7f893d3b6d16467a664f Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 10 May 2011 23:10:42 -0400 Subject: [PATCH] convert angles to radians --- glslUtil/glslUtil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glslUtil/glslUtil.c b/glslUtil/glslUtil.c index 29b1342..af316f8 100644 --- a/glslUtil/glslUtil.c +++ b/glslUtil/glslUtil.c @@ -92,8 +92,8 @@ void guMatrixRotate(guMatrix4x4 *m, GLfloat angle, ly /= scale; lz /= scale; } - GLfloat c = cos(angle); - GLfloat s = sin(angle); + GLfloat c = cos(M_PI * angle / 180.0); + GLfloat s = sin(M_PI * angle / 180.0); guMatrix4x4 mult; GLfloat oc = 1 - c; mult[0][0] = lx * lx * oc + c; @@ -154,7 +154,7 @@ void guPerspective(guMatrix4x4 *m, GLfloat fovy, GLfloat aspect, mult[i][j] = 0.0; } } - GLfloat f = 1.0 / tan(fovy / 2.0); + GLfloat f = 1.0 / tan(M_PI * fovy / 360.0); GLfloat nf = near - far; mult[0][0] = f / aspect; mult[1][1] = f;