Moving 3D objects

How can I move 3D objects?
Which is the GLUT function?

use glTranslatef(…) and glRotate(…) to move your
objects

But how can I move this quad for example one unit right.

glBegin(GL_QUADS);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);
glEnd();

Ok do you know what a cartesian plain is?
Consider youre 3D space a cartesian plane.
Ok now it depends whether you want to move the object or the entire scene. I’m gonna take it you want to move the object as you stated. After you pushed the matrix state, have glTranslatef(varX,y,z);
Ok every time the loop executes you can increment varX with a value, to get the object to move either left or right, considering that you did not change youre plain. I suggest, increment it with about 0.1f. Do you understand? To rotate it, you just change the angle at which it rotates, in other words you will have youre variable like so. glRotatef(varAngle, 0.0f,1.0f,0.0f);
Hope it helps

Oh crap yeah, almost forgot. Glut doesn’t have a specific function to translate or rotate, seeing that it’s so simple already.