This assignment will complete the core rotation utilities in our animation framework.
You will implement conversion routines between quaternions and matrices. After completing
this asisgnment, all your teapots will spin in unison.
Step 1: Get the source
This assignment will use the same basecode as the previous week.
Step 2: Compile and run
Compiling and running is the same as our
last lab.
Same as last week, the assignment demo shows teapots in a 3 by 3 grid. Each teapot tests a conversion function. This week, we will complete the demo with quaternion conversions.
> ../bin/Rotations
The executable should pop up an openGL window the looks something like the following
Assignment 2: Due Feb 13
Unit quaternions are a robust and compact way of representing rotations. In this
assignment, you will implement conversions between quaternions and matrices.
The basecode includes classes for 3x3 rotation matrices,
defined as
mat3 (located in libsrc\animation\aRotation.*) as well as
Quaternions
Quaternion (also located in libsrc\animation\aRotation.*)
- (10 points) Convert from 3x3 matrix to quaternion, Quaternion::FromRotation()
- (10 points) Convert from a quaternion to a 3x3 matrix, Quaternion::ToRotation()
- (10 points) Convert from a quaternion to angle axis, Quaternion::ToAngleAxis()
- (10 points) Convert from angle axis to a quaternion, Quaternion::FromAngleAxis()
Extra challenges:
These are optional assignment questions for those of you who want to take their assignments to the next level. Have your own idea you want to explore? Let the me know!
- Animate the colors of the teapot to change with the rotation. For example, if the euler angle is (50,75,100), convert it to a color (50/360, 75/360, 100/360). Develop a color mapping which you think looks cool, or helps visualize what's going on.
- Draw the local axes of the teapot. Use a red line to represent the X axis; a green line to represent the Y axis; and a blue line to represent the Z axis.
- Using Euler angles, demonstrate an example of gimbol lock and include it in your video.
- What happens if the transformation order is changed in drawDemo1()? Change the transformation order and see what happens!
Submission Guidelines
Submitting your assignment
Students should submit their code along with a README and videos. The README
can be very brief, consisting of
- answers to questions,
- descriptions of what was completed, including extra challenges, and
- how long the assignment took you and what was the hardest part
Videos should show results, including any extra challenges. Videos will be collected together and shown during class presentations. Please submit a mp4 of length no more than 60 seconds. For example
About checkins
You will be asked to briefly checkin (less than 1 minute) about your homework assignment. This is not intended to much work. Please don't prepare slides or a voice over for your video. None of these are necessary! Some ideas of what you might like to talk about:
- Give your name (at least to start, until everyone gets to know each other)
- Say one interesting thing about your assignment; ideally something unique to your experience. Some ideas
- Did you learn anything (os, programming, tools, etc) while working on the assignment that might be interesting or helpful to the whole class?
- Were there any interesting/surprising bugs that you encountered?
- Describe any extra challenges you completed.
- Did the assignment make you curious about any related topics?