Available on the class repo at tag homework-02-03 (solution is at homework-02-03-solution).

Zip up your submissions with your NYU id as the file name (e.g. rn47.zip) and upload them to this google drive folder by next class. Include comments to explain your reasoning or struggles. Remember that your best efforts and attempts are what counts the most! We will discuss this on Monday.

Using what we started in class finish the trail effect by adding

  1. Color gradient that animates along its path
    1. You're going to need a time uniform
    2. You're going to need a new "color" attribute
  2. Fade to transparent at the end
  3. Optional Limit the length of the trail, but keep it "anchored" to the mouse
  4. Optional Reduce the width of the trail towards the end
  5. Optional Change the colors towards the edges of the trail as well
  6. Optional Express the thickness of the trail in pixels, not NDC units

We almost got a trail drawing in class -- but the triangles wouldn't connect! It turns out the issue was that by pushing vertices every frame we were pushing vertices too fast and probably creating extremely thin triangles when the mouse was holding still. When I patched the code to only add vertices when the mouse moved a minimum distance, voila:

The notes are in the comments in the code!

Keep this diagram in mind when thinking about this code and this assignment. Remember that the geometry is built out of alternating A, B points calculated based on mouse movement and let that guide your problem solving!