![Page 1: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/1.jpg)
ICS201
Lecture 12 : Gentle Introduction to Computer Graphics II
King Fahd University of Petroleum & MineralsCollege of Computer Science & Engineering
Information & Computer Science Department
Based on:David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia
Jack van Wijk’s “Computer Graphics” Course Slides, University of Eindhoven.
![Page 2: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/2.jpg)
Outline
Introduction to 2D Modeling Transformations Matrix Representations Linear Transformations
![Page 3: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/3.jpg)
Introduction to Modeling Transformations
Specify transformations for objects Allows definitions of objects in own coordinate
systems Allows use of object definition multiple times in a
scene
![Page 4: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/4.jpg)
2D Modeling Transformations
ScaleRotate
Translate
ScaleTranslate
x
y
World Coordinates
ModelingCoordinates
![Page 5: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/5.jpg)
Scaling
Scaling a coordinate means multiplying each of its components by a scalar
Uniform scaling means this scalar is the same for all components:
2
![Page 6: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/6.jpg)
Non-uniform scaling: different scalars per component:
How can we represent this in matrix form?
Scaling
X 2,Y 0.5
![Page 7: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/7.jpg)
Scaling
Scaling operation:
Or, in matrix form:
by
ax
y
x
'
'
y
x
b
a
y
x
0
0
'
'
scaling matrix
![Page 8: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/8.jpg)
2-D Rotation
(x, y)
(x’, y’)
x’ = x cos() - y sin()y’ = x sin() + y cos()
![Page 9: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/9.jpg)
2-D Rotation
This is easy to capture in matrix form:
Even though sin() and cos() are nonlinear functions of ,
x’ is a linear combination of x and y y’ is a linear combination of x and y
y
x
y
x
cossin
sincos
'
'
![Page 10: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/10.jpg)
2-D Translation
(x, y)
(x’, y’)
x’ = x + txy’ = y + ty
tx
ty
![Page 11: ICS201 Lecture 12 : Gentle Introduction to Computer Graphics II King Fahd University of Petroleum & Minerals College of Computer Science & Engineering](https://reader036.vdocuments.mx/reader036/viewer/2022072014/56649e8a5503460f94b8f8fc/html5/thumbnails/11.jpg)
The end