# the glRotate matrix

I wanted to build myself the matrix that glRotate creates. In the redbook it is written:
The call glRotate*(a, x, y, z) generates R as follows:

Let v = (x, y, z)T, and u = v/| |v| | = (x’, y’, z’)T.

Also let Then But I am doing something wrong because my matrix is different from the one that glRotate creates.

I am creating it like this:

Vnorm(vect_rot); // u
double uu = vect_rot*vect_rot+vect_rot*vect_rot+vect_rotvect_rot;
double i_uu = 1 - uu;
double cos_tetha = cos(tetha), sin_tetha=sin(tetha);
double M= { uu+i_uu
cos_tetha, -vect_rot*sin_tetha, vect_rot*sin_tetha, 0,
vect_rotsin_tetha, uu+i_uucos_tetha, -vect_rot*sin_tetha, 0,
-vect_rot*sin_tetha, vect_rotsin_tetha, uu+i_uucos_tetha, 0,
0, 0, 0, 1};

Is this correct??

Thank YOU!

=]

the problem with you code is that uuT is a matrix and not a double (indeed the equation has no sense if the uuT is a real)
just try to compute uuT = (xx,xy,xz,
yx,yy,yz,
zx,zy,zz)
the same for I-uuT = (1-xx,xy,xz,
yx,1-yy,yz,
zx,zy,1-zz)
because I stands for the unit matrix
it should work fine by now