convert angles to radians

This commit is contained in:
Josh Holtrop 2011-05-10 23:10:42 -04:00
parent 513599d855
commit 64b76bd085

View File

@ -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;