Game Design Lab 2
Introduction to OpenGL
Beginning with the class example ``ring.c", develop a function that draws tensioned spoked wheels, as found on bicycles, motorcycles, and antique cars. It is not needed to parameterize the function for location, orientation, or size. However, the number of spokes can't easily be changed through opengl calls, and should be a parameter. So the function should take one parameter, which will be an integer.
A few notes about wheels:
Pick any colors that please you. Alternatively, you can avoid setting colors, in which case the wheel can be set to any solid color using a previous OpenGL call.
- Spokes alternate which side of the hub they originate from. So one the spokes won't originate from 0, 0, 0. I suggest drawing the wheel on the xy plane, with the hub extended in the Z direction. So the origin points will be (0, 0, w) and (0, 0, -w), where w is half the width of the hub.
- Spoked sheels are generallly laced in a pattern in order to resist torsional loads. For example, on a 36-spoke bicycle wheel, it is typical for each spoke to cross three others on the same side in route from the hub to the rim. In this lab, I recommend assuming a radial spoked wheel, as is often used for front bicycle wheels without disk brakes. Spokes can then be drawn from the z axis.