PDA

View Full Version : Another Rotation instead of GlRotate ??



Bruno
08-04-2000, 03:22 PM
HI
I'm tryng to do a function that does exactly what glRotatef does.
Well, could you people check it, to see what's wrong?

Shouldn't this routines rotate the point in the x axis by 90 degrees, just like
glRotatef(90,1.0,0.0,0.0) ??
x1 = x;
y1 = (y*cos(90))+(z*sin(90));
z1 = (y*cos(90))-(x*sin(90));

08-04-2000, 04:35 PM
Remember that C treats angles in radians (2*pi) versus degrees (360) for a full circle.

Bruno
08-04-2000, 10:45 PM
Thanks, but with Radians it's not working also http://www.opengl.org/discussion_boards/ubb/frown.gif

Bob
08-05-2000, 12:41 AM
Think is should be

x1 = x
y1 = y*cos - z*sin
z1 = y*sin + z*cos

And it this doesn't work, try change the x in your z1-formula to z.