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.
Your cube should look something like the following.
Your program should look something like this video.
Last modified February 14, 2023.