try to rotate object with this code.
main()
{
.
.
.
NextRotate(left);
.
.
.
}
NextRoate(move where)
{
.
.
.
.
.
glutTimerFunc(33,TimerFunctionroateEach, where);
}
TimerFunctionroateEach(where)
{
…
.
left? angle goes down (angle-=1)
right? angle goes up (angle+=1)
//slowly move until angle have been moved 90’
if(angle%90!=0)
TimerFunctionroateEach(angle);
.
.
}
RenderScen()
{
…
.
.
glRotatef(angle,1.0,0.0,0.0);
.
.
.
}
above code works well.
it shows how object rotate slowly, not just show how it become.
BUT when i try to rotate more than 2, like below code.
main()
{
.
.
.
NextRotate(left);
NextRotate(left);
NextRotate(right);
.
.
.
}
// other code are same.
it’s not work like function to function.
i expected to rotate left first, AND THEN left again, AND THEN right rotate.
BUT it works like all NextRoate() functions works at once, so i just can see part of last rotate (right).
want to rotate one by one. plz help me…