Graphics Programming: Transformations
description
Transcript of Graphics Programming: Transformations
![Page 1: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/1.jpg)
Graphics Programming
Graphics Programming:Transformations
![Page 2: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/2.jpg)
Transformation (Isometry) Translations Rotations Scaling Mirror
![Page 3: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/3.jpg)
Transformations
One example of a transformation is the window to viewport transformation.
Here we have seen an image in the world window scaled and translated (moved) into a viewport window.
We can build on this transformation to allow us to move objects to more complex locations.
![Page 4: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/4.jpg)
Transformations A Transformation consists of:
a Rotation a Scaling and a Translation a Shearing
They occur in 2D
and 3D
![Page 5: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/5.jpg)
Transformations
Transformations allow for: scene composition
![Page 6: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/6.jpg)
Transformations Transformations allow for:
easily create symmetrical objects
![Page 7: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/7.jpg)
Transformations
Transformations allow for:
viewing objects at different angles
computer animation where several objects need to move relative to one another
![Page 8: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/8.jpg)
Translation
![Page 9: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/9.jpg)
Scaling
![Page 10: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/10.jpg)
Rotation
![Page 11: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/11.jpg)
Reflection (flip)
![Page 12: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/12.jpg)
Combining Transforms
![Page 13: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/13.jpg)
Combining Transforms
![Page 14: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/14.jpg)
Combining Transforms
![Page 15: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/15.jpg)
Transforming Points
A transformation simply takes a point and maps it to another location.
![Page 16: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/16.jpg)
Transforming Points
In the 2D case this means…. Q = M(P)
where M is some mapping matrix
P
Q
![Page 17: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/17.jpg)
Matrices : Addition
![Page 18: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/18.jpg)
Matrices : Multiplication
2x - y + 2z = 1x + 2y - 4z = 33x - y + z = 0
![Page 19: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/19.jpg)
Matrices : Multiplication
![Page 20: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/20.jpg)
Matrices : Rotation
![Page 21: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/21.jpg)
Matrices :Identity Matrix
1 0 0
0 1 0
0 0 1
2 3 4
4 7 5
5 2 8
=
2 3 4
4 7 5
5 2 8
x
![Page 22: Graphics Programming: Transformations](https://reader033.fdocuments.in/reader033/viewer/2022050723/568159e8550346895dc73381/html5/thumbnails/22.jpg)
Further Reading
See Rowe – Chapter 2 for a discussion on homogenous coordinates and further examples of matrix transformations.
Also see discussions and technical articles on:
www.gamedeveloper.com
www.gamedev.net
www.ddj.com Dr. Dobb’s Journal
- been around since 1976