• Advertisement
Sign in to follow this  

Moving Object from one position to the other

This topic is 2409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

this is supposed to be easy...but i dont understand what i am doing wrong....trying to move my object from one position to another in an animation...but it just keeps moving and wont stop....any ideas on how i could achieve this ....a short snippet would be helpful thanks





glPushMatrix();
glTranslatef(pos1X,Pos1Y,Pos1Z);
glRotatef( rot_a, 0, 0, 1 );
Draw_A();
glPopMatrix();

glPushMatrix();
glTranslatef(pos2X,Pos2Y,Pos2Z);
glRotatef( rot_b, 0, 0, 1 );
Draw_B();
glPopMatrix();

void idle(){

if ( animate==false ){
if (pos1X > 0)
pos1X -= 0.020f;
}
if (pos1X == 0)
animate=true;

rY += 0.02;
glutPostRedisplay();
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement