Waves
Check your repo for the Waves
program. Modify the surface normals to produce a wave pattern. Create your wave pattern as follows:
- Get an offset vector from the center of the object to the point of interest
- Get the distance d of this offset vector
- Once you have the distance, normalize the offset
- Compute a scale as
cos((dis*5-time)*4)
- Scale the offset by half of the scale factor
- Get a new normal as the normalized sum of scaled offset and the normal
- Color the surface with this new normal
The GLSL functions length
and normalize
will be useful.
Once you are done, show your instructor and turn in your answer sheet.
Your solution should look similar to this: