test your knowledge ?
i have some question, why in the 18th tutorial from nehe about Quadrics, the movement of the box is faster then the others (quadric)object ?
i make program that the idea is simple, i just make 2 sphere and i plant to move the sphere to make a circle at the screen. so now i have 2 sphere, one is at the right side and the other is at the left side. at the left one i only use simple math calculation to make the left one move circling by only using translation, and at the other one, i use rotate and translation to make the sphere move circling. Both of them is run together with the rotation speed is 1.0f degree counter clock wise, but the result is the left one is moving alot faster then the right one. In the program, for the rotation i use the same variable for the degree of rotation for both the spheres. any one can tell me, what is really going on here ???
the math formulas are only like this
xpos = cos(zrotation) * r;
ypos = sin(zrotation) * r;
glTranslatef(xpos,ypos,zpos);
r : distance between the centre of the sphere and the centre of sphere rotation
the other one is
glRotatef(zrotation,0.0f,0.0f,1.0f);
glTranslatef(r,0.0f,zpos);
Simple!!!...
sin and cos of c++ ("math.h") are in radians and openGL in degrees....
Filami
Techno Grooves
sin and cos of c++ ("math.h") are in radians and openGL in degrees....
Filami
Techno Grooves
Techno Grooves
thx for the answer, but still can''t someone tell me why the box is moving alot faster then the quadrics object???
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement