## Interactive Computer Graphics - Assignment 4

### 3D Transformations and Geometry in WebGL

Topics:

Defining and drawing 3D objects with color

Implementing transformations

Interface for controlling transformations

Create a WebGL web page that displays a transformed 3D colored cube.

Allow the user to transform the cube via key input.

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

All transformations are then composed and applied to the cube.

The cube should only move (incrementally) in response to a keystroke.

The cube is NOT animated.

Cube geometry and color are defined by the example code 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.

The scale factors should always be positive

Define two keys for increasing and decreasing the
delta added to the transformations.

Each transformation should have its own delta value.

The deltas should always be positive.

Define a key for resetting all of the transformations and delta values.

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 web page should display instructions below the WebGL
canvas describing the functionality of your keyboard inputs.

Note that since you will be using the default orthographic
projection, translation in the Z direction should have no
visible effect on the size of your cube.

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.

Your program should look something like this video.

### Grading Scheme

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

Last modified February 14, 2023.