robertmachardy

05-05-2009, 09:47 AM

Why would the following render a cube at the orgin differently?

Note, the results look very similar, the cube has the same size and orientation, but it appears closer to the top of the viewport using the glRotated() and glTranslated() approach.

gluLookAt(1, 1, 1,

0, 0, 0,

0, 1, 0);

and

// rotate around the y axis

glRotated(-45, 0, 1, 0);

// rotate around the "rotated" x axis

glRotated(45, cos(radians(45)), 0.0, -sin(radians(45)));

glTranslated(1, 1, 1);

Note, the results look very similar, the cube has the same size and orientation, but it appears closer to the top of the viewport using the glRotated() and glTranslated() approach.

gluLookAt(1, 1, 1,

0, 0, 0,

0, 1, 0);

and

// rotate around the y axis

glRotated(-45, 0, 1, 0);

// rotate around the "rotated" x axis

glRotated(45, cos(radians(45)), 0.0, -sin(radians(45)));

glTranslated(1, 1, 1);