Sign in to follow this  
OgbobeBuko

Moving Object from one position to the other

Recommended Posts

OgbobeBuko    100
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

[code]



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();
}

[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this