GPU Programming Lab 2
Using a uniform variable
If you don't have them already, grab the tutorials with a command like this:
git clone https://gitlab.com/wikibooks-opengl/modern-tutorials
Make the triangle in the first (or second or third) tutorial a little smaller each frame, or time period. You will need:
Show me your completed lab when you have finished.
- A count of how many frames have happened, or the time. glutGet can be used to get GLUT_ELAPSED_TIME if you prefer the time method.
- Scaling formula can be whatever you like.
- You'll need a uniform variable to pass either a scaling factor, or transformation matrix into the vertex shader. Either way can work. "fade" in tutorial 3 is a decent candidate.
- After shrinking, the triangle can either shrink to be invisible or grow again.