Topics:

Defining and drawing 3D objects with color

Implementing transformations

Interface for controlling transformations

Create an OpenGL program that displays a 3D colored cube.

Allow the user to transform the cube via key input.

Keystrokes should modify the specified transformation (scaling, translation and rotation).

Cube geometry and color are defined in Lecture 8.

Enable the depth test to ensure proper display.

Create a menu that allows the user to specify the transformation to be modified. (SCALE, ROTATE, TRANSLATE)

Apply all of the transformations in the order of scale, rotation, then translation, at each update.Define six keys for increasing and decreasing the X,Y,Z components of the current transformation.

The cube should only be transformed with each key stroke.Define two keys for increasing and decreasing the delta added to the transformations.

Each transformation will have its own delta.Define a key for resetting all of the transformations.

You may decide where to calculate the necessary transformation matrices, in the application or in the vertex shader.

The transformation matrix should be applied to your vertices in the vertex shader.

Do not apply camera or projection transformations.

Your program should print instructions to the terminal screen describing the functionality of your keyboard inputs.

This should be the only text output that your program generates.

Of course if you transform the cube outside of the default view volume, it will be clipped.

Your cube should look something like the following.

- Defining cube geometry and colors: 1 point
- Correct viewing: 1 point
- Correct rotations: 2 points
- Correct scaling: 2 points
- Corect translations: 2 points
- Mouse interaction: 1 point
- Keyboard interaction: 1 point

Last modified February 8, 2017.