Rotate and pivot

I am trying to rotate and pivot a cyclinder, like a robot arm,

I would pivot at the base of the arm, so the whole arm would move in a clock like behaviour, but i also need to rotate the arm at any time

I need to keep track of the arm rotating so that i can get the vector for rotating the arm

Any tips?

It sounds like you are doing a tutorial to teach you about hierarchical transformation on the modelview matrix.

Look at pushmatrix, popmatrix, glrotate and gltranslate function calls.

Read the appropriate chapter of the red book instead of asking online.

See example 3.7 here:

Ported to glut here:

Thanks Dorbie,

that was really helpful.

I’m totally new to this 3D arena and should really be buying a book (as soon as i get some money) :slight_smile: