PDA

View Full Version : Code sample for Spinning Coin



rlinsurf
10-05-2005, 01:03 AM
Hi--

Does anyone know of a code sample which shows how to do a spinning coin?

Thanks :)

All My Best,
Jeffrey

Hlz
10-05-2005, 10:40 PM
You could create a really short cylinder and rotate it over time. Look at the primitves like GL_QUADS or GL_TRIANGLES (with optional _STRIP) for the sides and GL_TRIANGLE_FAN for the caps, and look at glRotatef to spin your coins with a time variable or frame counter for starters. Then you could add textures and lighting to it.

The red/blue books are a must have. I still have my version 1.2 redbook, though it's in complete tatters now :-)
http://www.rush3d.com/reference/opengl-redbook-1.1/
http://rush3d.com/reference/opengl-bluebook-1.0/

You can also buy these online (updated versions).