Draw GEAR(HELP!!!!!!!!!!!!!!!! )

Can anybody tell me how to draw a gear ?? where should I start?? From which Point should I count?? How to count the radius???
Please HELP

Hi there!

I guess the problem you have is that you don’t know how to calculate points on a circle. Well, i’ll explain it to you:

Let’s say we want to draw a circle with a given radius called RADIUS. Let’s say that each point on the circle is a tooth from the gear. Let’s also say that your gear has ten teeth. To calculate the x and y coords for each tooth, you use the following formulas:

t=given tooth
NUMBER_OF_TEETH=number of teeth on gear

x(t)=
RADIUSsin(t(360/NUMBER_OF_TEETH)/180/PI)

y(t)=
RADIUScos(t(360/NUMBER_OF_TEETH)/180/PI)

That’s it, because i think it’s the math you
have a problem with.

Please mail me if you want an example and i’ll see what i can do (then i’ll try to create something that looks like a gear )

Ciao,

Niftybitz.

There is a gear example in the SDK!

I’ve just made an example of two rotating gears (they are 3D and totally composed of triangles) with the option of realtime changing the thickness of the gear teeth, the number of teeth and the height of the teeth.

Anyone interested in this example, feel free to mail me (it’s written in VC++ 6.0)

Ciao,

Niftybitz.

You can e-mail it to me…
Love to see other people work…

My e-mail is listed here.

Originally posted by Niftybitz:
[b]I’ve just made an example of two rotating gears (they are 3D and totally composed of triangles) with the option of realtime changing the thickness of the gear teeth, the number of teeth and the height of the teeth.

Anyone interested in this example, feel free to mail me (it’s written in VC++ 6.0)

Ciao,

Niftybitz.[/b]