I have an object located at the origin and I’m trying to translate it using my own matrix(instead of glTranslate). My matrix looks like this:
float translate[16] = { 1.0, 0.0, 0.0, 5.0,
0.0, 1.0, 0.0,-3.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0 };
Simple right? Well the problem is that I don’t what to do to make it translate my object. I tried using glLoadMatrix and then glMultMatrix, but my object doesn’t move. Am I doing something wrong?
Thanks, Bino
[This message has been edited by Bino (edited 09-12-2000).]
Forget that first question. I have a new one How do I rotate an object using matrices? I how to set up the matrix, but what do I do after that?(Since glMultMatrix doesn’t work anymore) I heard you have to use loops or something like that, is that right?
Thanks, Bino
[This message has been edited by Bino (edited 09-12-2000).]
typedef float Matrixf[16];
void CreateRotateMatrixf (Matrixf mat, float a, float x, float y, float z)
{
float InvSqrt = isqrt (x * x + y * y + z * z);
float Ux = x * InvSqrt,
Uy = y * InvSqrt,
Uz = z * InvSqrt;