Translating different objects at different speeds

I want to translate three circles at three different velocities but at the same time. How do i do that? If i use the glTranslatef() funciton, it translates all the objects/circles i have dreawn.
I’m absolutely new to the openGL. Im using C.
Thank you.

You can use glPushMatrix() then translate the first object and draw it then end it with glPopMatrix().

Could you pls give more details with a bit of codes?
Suppose drawCircle1() draws the 1st circle and drawCircle2() draws the 2nd circle. What code do i have to write to translate the 2 cirlces at different speeds/velocities?

Well, each frame the circles are in some spot. You compute the spot in your code ( I don’t know how you want them to move ). Then you do something like this:


glPushMatrix();
glTranslatef(x,y,z);
drawCircle1();
glPopMatrix();

glPushMatrix();
glTranslatef(x,y,z);
drawCircle2();
glPopMatrix();

In the first section, x,y and z are the location of the first circle, and the second time they are the location of the second circle. Update the screen, recompute the positions for the next frame, and repeat.