about lesson 4
The rotation variables for the triangle and square in lesson 4:
rtri+=0.2f;
rquad-=0.15f;
I didnt find any code that set them back to 0 when they reach 360 or -360.
How is it that it continues to rotate properly?
They continue to rotate properly because all of the trig functions repeat themselves. sin(10) == sin(370) == sin(730) and so on. And I wouldn''t be surprised if OpenGL (you''re talking about NeHe''s stuff, right?) automatically wraps whatever you give it.
quote:
They continue to rotate properly because all of the trig functions repeat themselves. sin(10) == sin(370) == sin(730) and so on.
wrong, because the trig functions accept parameters in radians
![](wink.gif)
but yeah thats how it works
when it overlaps it just starts over again
Oh, so the call to glRotatef(rquad,1.0f,0.0f,0.0f); would loop rquad back to 0 if needed?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement