Trackball

Create a trackball interface. Your repository will contain template code. Be sure to fill in all the TODO blocks. The interface should allow the object to be rotated and translated in all directions. If the mouse is moving when the button is released, the object should continue to spin. You should use perspective projection. The window should be resizable and when resized the object should maintain the proper aspect ratio.

Here is some starter code:

It goes in the WorldState constructor.

translateToOrigin = glm::translate(glm::mat4(1.0f), -model.getCentroid() |
totalModelTransform = translateToOrigin;

Rubric

Model is at origin Not at origin : -1 At origin : 0
Intuitive interface Interface does not function : 0 Click+drag allows rotation, translation along xy, and translation along z. : 1
Perspective projection Incorrect perspective projection : 0 Correct perspective projection : 1
Rotation No rotation : 0 Incorrect rotation : 1 Vertical drag rotations X , horizontal drag rotates Y, non-centered drag rotates Z : 2
XY Translation No translation : 0 Vertical drag moves along Y, horizontal drag moves along X : 1
Z Translation No translation : 0 Vertical shift+drag moves along Z : 1
Transform order Unnatural transforms : 0 Rotation and translation remain natural after manipulation. : 2
Spinning No spinning : 0 Spin based on drag velocity : 1
Resize Resize incorrect : 0 Object has correct aspect ratio after resize and fills window : 1

Reference solution