VM - Translations Lesson
Translations
The usefulness of a matrix in computer graphics is its ability to convert geometric data into different coordinate systems. One way in which we can transform computer graphics is by translating them. Translating means to shift up, down, left or right.
Let's say we have a parallelogram with the following vertices: A(-1, -2), B (4, -2), C (6, 1), D(1, 1)
We could put those vertices in a matrix: P=[−1461−2−211]
Then, what do you think would happen to the parallelogram if we did this: P=[−1461−2−211]+P=[−1−1−1−12222]
The resulting matrix would be: P=[−23500033]
Let's say I have a set of coordinates like the parallelogram: A(-1, -2), B (4, -2), C (6, 1), D(1, 1)
Since I know that when you multiply matrix the "number of columns in the first matrix has to match with the number of rows of the second matrix". So the transformation matrix will be in the front. Because the transformation matrix is a 2x2 matrix. When we put the coordinates of a polygon as a matrix, the number of rows will always be 2. Therefore, when multiplying matrix for transformation. The transformation matrix must come first.
[−1001]×[−1461−2−211]
[(−1)(−1)+0(−2)(−1)(4)+0(−2)(−1)(6)+(0)(1)(−1)(1)+(0)(1))(0)(−1)+(1)(2)(0)(4)+(1)(−2)(0)(6)+(1)(1)(0)(1)+(1)(1)]
=[1−4−6−1−2−211]
This means this is a transformation on a reflection over the y-axis. Notice the values of the coordinates changed sign.
Watch the video to see how to use the transformation matrix to translate a triangle in the coordinate plane.
- What transformation matrix represents the translation from
△ABC⟶△A′B′C′?
- Solution:
[−3−3−3111]
- If T is a vertices matrix, what does
T+[5555−4−4−4−4] represent?
- Solution: Translated right 5 and down 4
- If T is a vertices matrix, what does
T+[−3−3−3−37777] represent?
- Solution: Translated left 3 and up 7
[CC BY-NC-SA 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION - INTENDED ONLY FOR USE WITHIN LESSON.