Calculate gears rotation for a realtime simulation

Posted by nkint on Game Development See other posts from Game Development or by nkint
Published on 2012-12-12T16:14:55Z Indexed on 2012/12/12 17:20 UTC
Read the original article Hit count: 286

Filed under:
|
|

Hi I'm trying to do a game with real time simulations of gears. There is a big Gear with inside a smaller gear.

I managed to draw gears with different diameters but equal size teeth, but if i try to move the smaller one inside the bigger one the movement is odd.

see the animated gif.

the biggest gear is in center C1 and the small in the center C2. I calculate C2 position in this way:

C2.x = C1.x + C1_RADIUS-C2_RADIUS) * cos(t);
C2.y = C1.y - C1_RADIUS-C2_RADIUS) * sin(t);

for t that goes from 0 to TWO_PI in n steps.

I apply as rotation the angle t, but maybe it is wrong and i have to calculate another rotation for get a perfect joint

© Game Development or respective owner

Related posts about physics

Related posts about rotation