Demo Number 3
The code:
Major changes
- Vertex shader is radically different.
- Generates colors based on the distance from the origin and the
quadrant of the the original point.
- Spin the entire figure based on an uniform angle variable.
The fragment shader uses the colors generated in the vertex shader
- The Spiral class has several new member functions
- A toggle display function, you can turn drawing off.
- A NextTheta function to increment theta
- The Spiral class also
- Now needs the program so it can use the uniform variable theta
- The UI class now
- Allows the user to turn the display of the hex and spiral on and off
- Starts and end animation
- This just uses the glutIdleFunc
- This is not the best way to animate, as it will not be "regular"
- But it will do for now.
- The main routine has been changed to allow the hex to be turned on and off.