Okay, Ive got a cog (toothed gear) that I have drawn in opengl. I have a cylinder attached to one side of it thats supposed to model a handle (Basically, im making a simulation of a hand-cranked drill). Now when i rotate the cog (working), I want the cylinder to move as if it is attached to it. The centre-hole of the cog is at the origin, by the way.
I.e i want it to work like in this pic:
http://www.uktoolcentre.co.uk/ProductImages/25133/BIG/BIG/25133.jpg
except the handle part will be sticking straight out of the red bit, instead of on an extension.
I just cant get my head around the maths to make it so that when i rotate the cog, the cylinder moves as if it is attached to it.
Any help?