PDA

View Full Version : how to make two gear turn in 360 degree ?



08-03-2002, 06:41 AM
I need to make two of the gear turn at teh same time.I suppose to turn in clockwise and another one suppose to turn in anti-clock wise.
I know it sound confusing but I really hope that sombody can understand my question and provide my some idea on it.
Really out of idea.Thanks

nexusone
08-04-2002, 05:24 AM
It is very simple, to make two gears move like they would in the real work, the code should look something like this:


glPushMatrix(); // Gear 1

glTranslate(.....); // Move to location on screen
glRotatef( gear_rotation_1, 0, 0, 1); // Rotate gear

DrawGear();

glPopMatrix();

glPushMatrix(); // Gear 2

glTranslate(.......); // Move to location on screen
glRotatef( gear_rotation_2, 0, 0, 1); // Rotate gear

DrawGear();

glPopMatrix();

Note some extra code is needed, but hope it gives up an idea....



Originally posted by Claudee:
I need to make two of the gear turn at teh same time.I suppose to turn in clockwise and another one suppose to turn in anti-clock wise.
I know it sound confusing but I really hope that sombody can understand my question and provide my some idea on it.
Really out of idea.Thanks

Niftybitz
08-09-2002, 02:39 AM
For the very last time: Mail me and i'll give you an example program i wrote for this problem.

Ciao,

Niftybitz.