CPSC 424 | Computer Graphics | Fall 2025 |
This lab is about one of the fundamentals of computer graphics — transformations.
Successful completion of this lab means that you:
have become familiar with the effects of the three basic transformations (translation, rotation, and scaling) and have gained an appreciation for how the order in which they are applied affects the outcome
You can play the transformation game alone or team up with one other person to solve the puzzles.
No AI.
Hand in a hard copy of your answers for the transformation game. (List the transformation(s) required to solve each of the 20 levels, writing the transformations in the same left-to-right order as they appear in the transformation chain in the game.) Only one handin per group is needed. (Be sure to include the names of everyone in the group.)
Transformations such as translation, rotation, and scaling are at the heart of the viewing pipeline. In this assignment, you'll play a game of sorts in which you'll build up series of transformations to achieve particular goals. The purpose of this task is to become familiar with the effects of these three core transformations and to gain an understanding of how the order in which transformations are applied affects the outcome.
The transformation game software comes from the Brown University Exploratories project. For more information on exploratories see the Exploratories home page.
Open a terminal window and run the game with the commandline
java -jar /classes/cs424/lab1/transformation_game.jar
The following directions are taken from the transformation game description page:
The goal of this applet is to move the house (originally located at the origin of the play space) using individual transformation blocks so that it matches the darker destination house which is also located in the play space. When a match is detected by the program, the house will flash and a sound will be played. Move through individual challenges (of increasing levels of difficulty) by clicking on the Prev and Next buttons in the lower portion of the screen. There are currently twenty levels available.
The small puzzle-like pieces on the right side of the area represent individual transformation blocks (T = Translation, S = Scale, R = Rotation). Drag individual transformation blocks to the transformation chain area in the lower portion of the screen. The currently active transformation block is highlighted. When multiple blocks are present in the transformation chain, click on a block to activate it. When a transformation block is active, clicking and dragging the house in the central play area changes the parameters of the transformation (i.e., click and drag the house to translate it when a translation block is active). A transformation block whose legend includes a small asterisk indicates that the transformation will be animated by the program.
Note that while the transformations in a chain are shown from left to right, they are actually applied from right to left. For example, for a two-transformation chain
R 20 deg, T X: -75the translation is applied to the house first, then the rotation is applied to the translated house. This might seem backwards, but when transformations are representated by matrices, it corresponds to the order of matrix multiplications. (Matrix multiplication is not commutative, so the order of multiplications matters.)
Complete all 20 levels of the game. (Levels 14 and 15 are the most challenging.)
Note that the applet has a couple of bugs, but you can work around them:
It is possible in some cases to get the program to detect a match when the answer is not correct. Don't be misled — you are still expected to come up with the correct answer. (A correct answer is one where the houses line up.)
The S* transformation (animated scale) has some problems. In particular, it doesn't animate. However, it is still possible to tell what the solution should be. Strive for this, and don't expect the program to detect a match.
Aim for an exact match, but it's OK if you are close. For example, if the correct solution is T X: 100, T X: 102 is OK.