CS 381 HW2--Vectors, Matrices, and Rotations

This homework is based on the "glsl_sliders" program. You can download a binary for Windows and Linux (Zip, Tar-gzip).  You shouldn't have to recompile this program (and in fact, until I post the libraries needed, you can't!).
  1. Write a vertex program to scale object along the X axis by a factor of 1.4, shift the object to the left by 0.5, and then scale it along the Y axis by a factor of 0.3.  Name your vertex program "problem1.txt" when you submit it in Blackboard.

  2. Write a vertex program to rotate the object counterclockwise onscreen by 45 degrees.  Name your vertex program "problem2.txt" for submission.
  3. Write a vertex program to rotate the object counterclockwise onscreen by "spin_x" radians, where "spin_x" is a "uniform" variable exported by the C++ code.  Name your vertex program "problem3.txt".

  4. Write the same rotation vertex program as problem3, but use a perspective camera where you divide by "v.z+2.0", and use a single mat4 matrix to do *both* the rotation *and* perspective.  Name your vertex program "problem4.txt".

Turn in your problem vertex program "problem*.txt" files via Blackboard. Due midnight Thursday, September 14th.  WARNING: If your vertex programs don't compile, you won't get any points!  Be sure to try them out before submitting them!

(Bug fix Saturday afternoon: rotate *counterclockwise*, like the picture, not *clockwise*, like I mistakenly described above.)

If Blackboard doesn't work for you, or you don't have an account, you can email this homework to me at ffosl@uaf.edu.


Back to CS 381 Home Back to CS Home Back to UAF Home