1. The document discusses various 2D and 3D geometric transformations including translation, rotation, scaling, and their properties.
2. It explains coordinate systems used to specify geometry including world, user, and display coordinates.
3. Key geometric transformations are defined through transformation matrices including translation, rotation, and scaling matrices. Concatenating transformations allows combining multiple transformations.
This is an introduction to 2D and 3 in computer graphics presented by daroko blog.
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer relate courses.ly
• Be practically real, not just academic reader
it is related to Computer Graphics Subject.in this ppt we describe what is 2D Transformation, Translation, Rotation, Scaling : Uniform Scaling,Non-uniform Scaling ;Reflection,Shear,Composite Transformations
This is an introduction to 2D and 3 in computer graphics presented by daroko blog.
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer relate courses.ly
• Be practically real, not just academic reader
it is related to Computer Graphics Subject.in this ppt we describe what is 2D Transformation, Translation, Rotation, Scaling : Uniform Scaling,Non-uniform Scaling ;Reflection,Shear,Composite Transformations
Bezier Curves, properties of Bezier Curves, Derivation for Quadratic Bezier Curve, Blending function specification for Bezier curve:, B-Spline Curves, properties of B-spline Curve?
Slides from when I was teaching CS4052 Computer Graphics at Trinity College Dublin in Ireland.
These slides aren't used any more so they may as well be available to the public!
There are some mistakes in the slides, I'll try to comment below these.
This is the third lecture - on using linear algebra for transformations.
Bezier Curves, properties of Bezier Curves, Derivation for Quadratic Bezier Curve, Blending function specification for Bezier curve:, B-Spline Curves, properties of B-spline Curve?
Slides from when I was teaching CS4052 Computer Graphics at Trinity College Dublin in Ireland.
These slides aren't used any more so they may as well be available to the public!
There are some mistakes in the slides, I'll try to comment below these.
This is the third lecture - on using linear algebra for transformations.
Transformation:
Transformations are a fundamental part of the computer graphics. Transformations are the movement of the object in Cartesian plane.
Types of transformation
Why we use transformation
3D Transformation
3D Translation
3D Rotation
3D Scaling
3D Reflection
3D Shearing
Scaling Transform Methods For Compressing a 2D Graphical imageacijjournal
Transformation is a process of converting the original picture coordinates into a different picture
coordinates either by adding some values with original coordinates(Translations) or Multiplying some
values with original coordinates(called Linear transformations like rotation, reflection, scaling, and
shearing). In this paper, we compress a two dimensional picture using 2D scaling transformation. In the
several scenarios, the utilization of this technique for image compression resulted in comparable or better
performance, when compared to the Different modes of image transformations. In this paper We tried a
new code for compressing an 2d gray scale image using scaling transform methods. Matlab concepts are
applied to compress the image. We have plan to apply The techniques and develop a code for compressing
a 3d image.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
2. 10/5/2022 2
Intro & General Information
Geometric Transformations
Construction
(translate, rotate, scale, mirror)
Viewing
(projections, zooming)
Animation
(processes, vibration)
3. Coordinate Systems
In order to specify the geometry of a given solid, it is necessary to
use a variety of coordinate systems. Its Major classifications are:
World Coordinate System: Also known as the "universe" or
sometimes "model" coordinate system. This is the base reference
system for the overall model, ( generally in 3D ), to which all other
model coordinates relate
User Coordinate System: Also known as “working” coordinate
system. When it is difficult to define certain geometries using
WCS, In such cases user coordinate system can be defined relative
to the WCS.
Display Coordinates: This refers to the actual coordinates to be
used for displaying the image on the screen.
4. 10/5/2022 4
General Information
Transformation of a point is basic in GT. It can be formulated as follows:
Given a point P that belongs to a geometric model find the corresponding
point P* in the new position such that
P* = f(P, transformation parameters)
• The transformation parameters should provide ONE-TO-ONE-
MAPPING.
• Multiple transformations can be combined to yield a single
transformation which should have the same effect as the sequential
application of original ones. CONCATENATION /kənˌkatnˈāSH(ə)n/
Equation of P* for graphics hardware should be in matrix notation:
P* = [T]P,
where [T] is the transformation matrix.
5. Geometric Transformations
Sometimes also called modeling
transformations
Geometric transformations: Changing an object’s
position (translation), orientation (rotation) or size
(scaling)
Modeling transformations: Constructing a scene
or hierarchical description of a complex object
Others transformations: reflection and
shearing operations
5
6. 1. Geometric Transformations
What is transformation?
> It is the backbone of computer graphics, enabling us to
manipulate the shape, size, and location of the object.
> Changing something to something else via rules.
Why are they important to graphics?
> It can be used to effect the following changes in a geometric
object:
1. Change the location
2. Change the shape
3. Change the size
4. Rotate
7. 2. Types of Transformations
i. Geometric/Object Transformation
> This transformation alters the coordinate values of the object. Basic
operations are scaling, translation, rotation and combination of one
or more of these basic transformations.
> Object transformation = Move (transform) an object in the 2D/3D space.
ii. Visual/ Coordinate System Transformation
> In this transformation there is no change in either the geometry or the
coordinates of the object. A copy of the object is placed at the desired sight,
without changing the coordinate values of the object.
> Coordinate system transformation = Move (transform) the coordinate
system. View the objects from the new coordinate system.
9. 10/5/2022 9
Translation
Translation is a rigid-body transformation (Euclidean) when
each entity of the model remains parallel, or each point
moves an equal distance in a given direction:
P* = P + d (for both 2D and 3D). In a scalar form (for 3D):
x* = x + xd
y* = y + yd
z* = z + zd
C (11,7)
A (8,5)
B (10,8)
A*
C*
B*
y
x
O
Question: Find the coordinates of vertices A*, B*,
and C* of the translated triangle.
The distance vector of translation: D = [-7 -4]T.
Verify that the lengths of the edges are unchanged.
10. i. Translation - 2D
Moving an object is called a translation.
We translate a point by adding to the x and y coordinates,
respectively, the amount the point should be shifted in the x and y
directions.
We translate an object by translating each vertex in the object.
11. Basic 2D Geometric
Transformations
2D Translation
x’ = x + tx , y’ = y + ty
P’=P+T
Translation moves the object without deformation
(rigid-body transformation)
P
P’
T
y
x
t
t
T
y
x
P
y
x
P ,
'
'
'
,
11
12. Basic 2D Geometric
Transformations (cont.)
2D Translation
To move a line segment, apply the transformation
equation to each of the two line endpoints and
redraw the line between new endpoints
To move a polygon, apply the transformation
equation to coordinates of each vertex and
regenerate the polygon using the new set of vertex
coordinates
12
13. Scaling is used to change the size of an entity or a model.
P* = [S]P
sx 0 0
For general case [S] = 0 sy 0 ,
0 0 sz
If 0 < s < 1 - compression
If s > 1 - stretching
sx = sy = sz - uniform scaling, otherwise - non-uniform
10/5/2022 13
Scaling
where sx, sy, and sz are the scaling
factors in the X, Y, and Z directions
respectively.
Question: The larger circle is the scaled copy
of the smaller one. Can you say that we have a
uniform scaling? Why? Define y* and R*.
O(4,2)
O*(10,y*)
O
x
y
R 1
R*
14. ii. Scaling
> Changing the size of an object is called a scale. We scale an
object by scaling the x and y coordinates of each vertex in the
object.
15. 2D Rotation
Rotation axis
Rotation angle
rotation point or pivot point (xr,yr)
yr
xr
θ
Basic 2D Geometric
Transformations (cont.)
15
2D Geometric Transformations
16. 2D Rotation
If θ is positive counterclockwise rotation
If θ is negative clockwise rotation
Remember:
cos(a + b) = cos a cos b - sin a sin b
cos(a - b) = cos a sin b + sin a cos b
Basic 2D Geometric
Transformations (cont.)
16
2D Geometric Transformations
17. 10/5/2022 17
Rotation
Rotation is a non-commutative transformation (depends on sequence).
cos
0
sin
0
1
0
sin
0
cos
cos
sin
0
sin
cos
0
0
0
1
1
0
0
0
cos
sin
0
sin
cos
cos
sin
sin
cos
cos
sin
sin
cos
sin
sin
cos
cos
)
sin(
)
cos(
P
sin
cos
P
P
P
*
*
*
*
*
y
x
z
R
R
R
z
y
x
y
x
z
r
r
r
r
z
r
r
z
y
x
z
r
r
z
y
x
R
P*
P
x
y*
x*
y
X
Y
Z
Question: Let the length of a major and minor
axes of an ellipse with the center on the origin
of the CS be 2a and 2b respectively, and - the
angle between the major axis and the x-axis.
Then, derive the expression of an ellipse in the
(O,x,y) system.
18. iii. Rotation about the origin
ø Consider rotation about the origin by Θ degrees
ø Radius stays the same, angle increases by Θ.
19. 2D Rotation
At first, suppose the pivot point is at the origin
x’=r cos(θ+Φ) = r cos θ cos Φ - r sin θ sin Φ
y’=r sin(θ+Φ) = r cos θ sin Φ + r sin θ cos Φ
x = r cos Φ, y = r sin Φ
x’=x cos θ - y sin θ
y’=x sin θ + y cos θ
Φ
(x,y)
r
r θ
(x’,y’)
Basic 2D Geometric
Transformations (cont.)
19
2D Geometric Transformations
20. Basic 2D Geometric
Transformations
2D Rotation
P’=R·P
cos
sin
sin
cos
R
Φ
(x,y)
r
r θ
(x’,y’)
20
2D Geometric Transformations
24. 2D Scaling
Scaling is used to alter the size of an object
Simple 2D scaling is performed by multiplying
object positions (x, y) by scaling factors sx and sy
x’ = x · sx
y’ = y · sx
or P’ = S·P
y
x
s
s
y
x
y
x
0
0
'
'
Basic 2D Geometric
Transformations (cont.)
24
25. 2D Scaling
Any positive value can be used as scaling factor
Values less than 1 reduce the size of the object
Values greater than 1 enlarge the object
If scaling factor is 1 then the object stays unchanged
If sx = sy , we call it uniform scaling
If scaling factor <1, then the object moves closer to the
origin and If scaling factor >1, then the object moves
farther from the origin
x’ x
Basic 2D Geometric
Transformations (cont.)
25
26. 2D Scaling
Why does scaling also reposition object?
Answer: See the matrix (multiplication)
Still no clue?
𝑥′
𝑦′
=
𝑠𝑥 0
0 𝑠𝑦
∗
𝑥
𝑦 =
𝑥 ∗ 𝑠𝑥 + 𝑦 ∗ 0
𝑥 ∗ 0 + 𝑦 ∗ 𝑠𝑦
Basic 2D Geometric
Transformations (cont.)
26
27. 2D Scaling
We can control the location of the scaled object by
choosing a position called the fixed point (xf,yf)
x’ – xf = (x – xf) sx y’ – yf = (y – yf) sy
x’=x · sx + xf (1 – sx)
y’=y · sy + yf (1 – sy)
Polygons are scaled by applying the above formula
to each vertex, then regenerating the polygon using
the transformed vertices
Basic 2D Geometric
Transformations (cont.)
27
28. Example:
If the triangle A(1, 1), B(2, 1), C(1, 3) is scaled by a
factor 2, find the new coordinates of the triangle.
30. Cont’d…
Example:
• Rotate the rectangle (0, 0), (2, 0), (2, 2), (0, 2) by 30o
ccw about its centroid and find the new coordinates
of the rectangle.
32. 4. Homogeneous Coordinates
> In order to represent a translation as a matrix multiplication
operation we use 3 x 3 matrices and pad the points to become 3 x 1
matrices.
> This coordinate system (using three values to represent a 2D point) is
called homogeneous coordinates.
> Let the added extra coordinate be W, to a point: P (x, y, W).
> Two sets of homogeneous coordinates represent the same point if
they are a multiple of each other.
> If W ≠ 0 , divide by it to get Cartesian coordinates of point: (x/W,
y/W, 1).
> If W = 0, point is said to be at infinity.
39. 10/5/2022 39
Homogeneous Transformation
When we scale then rotate, the transformed image is given by:
P* = ([R][S])P
where [S], [R], [R] [S] are 3x3 transformation matrices. This is not the case
for a translation (P* = P + d). The goal is to find a [D] such that
P + d = [D]P
in order to perform valid matrix multiplication.
This is found by using a homogeneous coordinates.
Homogeneous Transformation maps n-dimensional space into (n+1)- dim.
3D representation of the point vector - P = [x, y, z]T
Homogeneous rep. of the same vector - P = [xw, yw, zw, w]T where w = 1
40. Matrix Representations and
Homogeneous Coordinates
Many graphics applications involve
sequences of geometric transformations
Animations
Design and picture construction applications
We will now consider matrix representations
of these operations
Sequences of transformations can be efficiently
processed using matrices
40
2D Geometric Transformations
41. Matrix Representations and
Homogeneous Coordinates (cont.)
P’ = M1 · P + M2
P and P’ are column vectors
M1 is a 2 by 2 array containing multiplicative
factors
M2 is a 2 element column matrix containing
translational terms
For translation M1 is the identity matrix
For rotation or scaling, M2 contains the
translational terms associated with the pivot point
or scaling fixed point
41
2D Geometric Transformations
42. To produce a sequence of operations, such
as scaling followed by rotation then
translation, we could calculate the
transformed coordinates one step at a time
A more efficient approach is to combine
transformations, without calculating
intermediate coordinate values
Matrix Representations and
Homogeneous Coordinates (cont.)
42
2D Geometric Transformations
43. Multiplicative and translational terms for a 2D
geometric transformation can be combined
into a single matrix if we expand the
representations to 3 by 3 matrices
We can use the third column for translation terms,
and all transformation equations can be
expressed as matrix multiplications
Matrix Representations and
Homogeneous Coordinates (cont.)
43
2D Geometric Transformations
44. Expand each 2D coordinate (x,y) to three
element representation (xh,yh,h) called
homogeneous coordinates
h is the homogeneous parameter such that
x = xh/h, y = yh/h,
infinite homogeneous representations for a
point
A convenient choice is to choose h = 1
Matrix Representations and
Homogeneous Coordinates (cont.)
44
2D Geometric Transformations
45. 10/5/2022 45
Homogeneous Transformation
The transformation matrices in new (homogeneous) representation:
1
0
0
0
0
0
0
R
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
33
32
31
23
22
21
13
12
11
r
r
r
r
r
r
r
r
r
M
s
s
s
S
z
y
x
D
z
y
x
d
d
d
46. 2D Translation Matrix
or, P’ = T(tx,ty)·P
1
1
0
0
1
0
0
1
1
'
'
y
x
t
t
y
x
y
x
Matrix Representations and
Homogeneous Coordinates (cont.)
46
2D Geometric Transformations
47. 2D Rotation Matrix
or, P’ = R(θ)·P
1
1
0
0
0
cos
sin
0
sin
cos
1
'
'
y
x
y
x
Matrix Representations and
Homogeneous Coordinates (cont.)
47
2D Geometric Transformations
48. 2D Scaling Matrix
or, P’ = S(sx,sy)·P
1
1
0
0
0
0
0
0
1
'
'
y
x
s
s
y
x
y
x
Matrix Representations and
Homogeneous Coordinates (cont.)
48
2D Geometric Transformations
49. Inverse Transformations
2D Inverse Translation Matrix
By the way:
1
0
0
1
0
0
1
1
y
x
t
t
T
I
T
T
*
1
49
2D Geometric Transformations
50. Inverse Transformations (cont.)
2D Inverse Rotation Matrix
And also:
1
0
0
0
cos
sin
0
sin
cos
1
R
I
R
R
*
1
50
2D Geometric Transformations
51. Inverse Transformations (cont.)
2D Inverse Rotation Matrix:
If θ is negative clockwise
In
Only sine function is affected
Therefore we can say
Is that true?
Proof: It’s up to you
I
R
R
*
1
T
R
R
1
51
2D Geometric Transformations
52. Inverse Transformations (cont.)
2D Inverse Scaling Matrix
Of course:
1
0
0
0
1
0
0
0
1
1
y
x
s
s
S
I
S
S
*
1
52
2D Geometric Transformations
53. 2D Composite Transformations
We can setup a sequence of transformations
as a composite transformation matrix by
calculating the product of the individual
transformations
P’=M2·M1·P
=M·P
53
2D Geometric Transformations
54. 2D Composite Transformations
(cont.)
Composite 2D Translations
If two successive translation are applied to a point P,
then the final transformed location P' is calculated as
1
0
0
1
0
0
1
1
0
0
1
0
0
1
1
0
0
1
0
0
1
2
1
2
1
1
1
2
2
y
y
x
x
y
x
y
x
t
t
t
t
t
t
t
t
P
T
P
T
T
P
)
,
(
)
,
(
)
,
(
' 2
1
2
1
1
1
2
2 y
y
x
x
y
x
y
x t
t
t
t
t
t
t
t
54
2D Geometric Transformations
56. Composite 2D Scaling
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
2
1
2
1
1
1
2
2
y
y
x
x
y
x
y
x
s
s
s
s
s
s
s
s
)
,
(
)
,
(
)
,
( 2
1
2
1
1
1
2
2 y
y
x
x
y
x
y
x s
s
s
s
s
s
s
s
S
S
S
2D Composite Transformations
(cont.)
56
2D Geometric Transformations
57. Don’t forget:
Successive translations are additive
Successive scalings are multiplicative
For example: If we triple the size of an object
twice, the final size is nine (9) times the original
9 times?
Why?
Proof: Again up to you
2D Composite Transformations
(cont.)
57
2D Geometric Transformations
58. General Pivot Point Rotation
Steps:
1. Translate the object so that the pivot point is
moved to the coordinate origin.
2. Rotate the object about the origin.
3. Translate the object so that the pivot point is
returned to its original position.
58
2D Geometric Transformations
60. General 2D Pivot-Point Rotation
1
0
0
1
0
0
1
1
0
0
0
cos
sin
0
sin
cos
1
0
0
1
0
0
1
r
r
r
r
y
x
y
x
1
0
0
sin
)
cos
1
(
cos
sin
sin
)
cos
1
(
sin
cos
r
r
r
r
x
y
y
x
2D Composite Transformations
(cont.)
60
2D Geometric Transformations
61. General Fixed Point Scaling
Steps:
1. Translate the object so that the fixed point
coincides with the coordinate origin.
2. Scale the object about the origin.
3. Translate the object so that the pivot point is
returned to its original position.
61
2D Geometric Transformations
62. General Fixed Point Scaling
(cont.)
(xr, yr) (xr, yr)
62
2D Geometric Transformations
64. 2D Composite Transformations
(cont.)
General 2D scaling directions:
Above: scaling parameters were along x and y
directions
What about arbitrary directions?
Answer: See next slides
64
2D Geometric Transformations
65. General 2D Scaling Directions
Scaling parameters s1 and s2 along orthogonal directions defined by the
angular displacement θ. 65
2D Geometric Transformations
66. General 2D Scaling Directions
(cont.)
General procedure:
1. Rotate so that directions coincides with x and y
axes
2. Apply scaling transformation 𝑆 𝑠1, 𝑠2
3. Rotate back
The composite matrix:
𝑅−1 Θ ∗ 𝑆 𝑠1, 𝑠2 ∗ 𝑅 Θ =
𝑠1 cos2 Θ + 𝑠2 sin2 Θ 𝑠2 − 𝑠1 cos Θ sin Θ 0
𝑠2 − 𝑠1 cos Θ sin Θ 𝑠1 sin2 Θ + 𝑠2 cos2 Θ 0
0 0 1
66
2D Geometric Transformations
67. 2D Composite Transformations
(cont.)
Matrix Concatenation Properties:
Matrix multiplication is associative !
M3· M2· M1= (M3· M2 ) · M1 = M3· ( M2 · M1 )
A composite matrix can be created by multiplicating left-
to-right (premultiplication) or right-to-left
(postmultiplication)
Matrix multiplication is not commutative !
M2 · M1 ≠ M1 · M2
67
2D Geometric Transformations
68. 2D Composite Transformations
(cont.)
Matrix Concatenation Properties:
But:
Two successive rotations
Two successive translations
Two successive scalings
are commutative!
Why?
Proof: You got it: Up to you
68
2D Geometric Transformations
69. 10/5/2022 6
9
Mirror
Plane* => Negate the corresponding coordinate
Mirror through Line* => Reflect through 2 planes intersecting at the axis
Point* => Reflect through 3 planes intersecting at the point
* plane - principal plane, line - X, Y, or Z axes, point - CS origin
P* = [M]P,
where [M] = =
Question: Define the signs (in the matrix)
for the reflections (mirroring) through:
a) x = 0, y = 0, z = 0 planes
b) X, Y, and Z axes
c) the CS origin
33
22
11
0
0
0
0
0
0
m
m
m
1
0
0
0
1
0
0
0
1
70. Reversing the order
in which a sequence of transformations is performed may affect the transformed
position of an object.
In (a), an object is first translated in the x direction, then rotated counterclockwise
through an angle of 45°.
In (b), the object is first rotated 45° counterclockwise, then translated in the x
direction
70
2D Geometric Transformations
71. Other 2D Transformations
Reflection
Transformation that produces a mirror image of an
object
71
2D Geometric Transformations
72. Reflection
Image is generated relative to an axis of reflection
by rotating the object 180° about the reflection
axis
Reflection about the line y=0 (the x axis) (previous
slide)
1
0
0
0
1
0
0
0
1
Other 2D Transformations (cont.)
72
2D Geometric Transformations
73. Other 2D Transformations (cont.)
Reflection
Reflection about the line x=0 (the y axis)
1
0
0
0
1
0
0
0
1
73
2D Geometric Transformations
74. −1 0 0
0 − 1 0
0 0 1
Reflection about the origin
Other 2D Transformations (cont.)
74
2D Geometric Transformations
75. Reflection about the line y=x
0 1 0
1 0 0
0 0 1
Other 2D Transformations (cont.)
75
2D Geometric Transformations
76. Reflection about the line y=-x
0 − 1 0
−1 0 0
0 0 1
Other 2D Transformations (cont.)
76
2D Geometric Transformations
77. Shear
Transformation that distorts the shape of an object
such that the transformed shape appears as the
object was composed of internal layers that had
been caused to slide over each other
y
x
(0,1) (1,1)
(1,0)
(0,0)
y
x
(2,1) (3,1)
(1,0)
(0,0)
shx=2
Other 2D Transformations (cont.)
77
2D Geometric Transformations
78. Shear
An x-direction shear relative to the x axis
An y-direction shear relative to the y axis
1
0
0
0
1
0
0
1
y
sh
1
0
0
0
1
0
0
1 x
sh
y
y
y
sh
x
x x
'
'
Other 2D Transformations (cont.)
78
2D Geometric Transformations
79. Shear
x-direction shear relative to other reference lines
1
0
0
0
1
0
*
1 ref
x
x y
sh
sh
y
y
y
y
sh
x
x ref
x
'
*
'
Other 2D Transformations (cont.)
79
2D Geometric Transformations
80. Example
A unit square (a) is transformed to a shifted parallelogram
(b) with shx = 0.5 and yref = −1 in the shear matrix from Slide 56
80
2D Geometric Transformations
81. Shear
y-direction shear relative to the line x = xref
1
0
0
*
1
0
0
1
ref
y
y x
sh
sh
ref
y x
x
sh
x
y
x
x
*
'
'
Other 2D Transformations (cont.)
81
2D Geometric Transformations
82. Example
A unit square (a) is turned into a shifted parallelogram
(b) with parameter values shy = 0.5 and xref = −1 in the y -direction shearing
transformation from Slide 58
82
2D Geometric Transformations
83. This slide is intentionally left blank
Your responsibility to fill it
Raster Methods for
Transformations and OpenGL
83
2D Geometric Transformations
84. Transformation Between
Coordinate Systems
Individual objects may be defined in their
local cartesian reference system.
The local coordinates must be transformed
to position the objects within the scene
coordinate system.
84
2D Geometric Transformations
85. Steps for coordinate transformation
1. Translate so that the origin (x0, y0 ) of the
x′-y′ system is moved to the origin of the
x-y system.
2.Rotate the x′ axis on to the axis x.
Transformation Between
Coordinate Systems
85
2D Geometric Transformations
90. An alternative method:
-Specify a vector V that indicates the direction
for the positive y′ axis. Let
-Obtain the unit vector u=(ux ,u y) along the x′
axis by rotating v 900 clockwise.
𝐯 =
𝐕
𝐕
= (𝑣𝑥, 𝑣𝑦)
Transformation Between
Coordinate Systems (cont.)
90
2D Geometric Transformations
91. Elements of any rotation matrix can be
expressed as elements of orthogonal unit
vectors. That is, the rotation matrix can be
written as
𝐑 =
𝑢𝑥 𝑢𝑦 0
𝑣𝑥 𝑣𝑦 0
0 0 1
Transformation Between
Coordinate Systems (cont.)
91
2D Geometric Transformations
93. OpenGL Geometric
Transformation Functions
A separate function is available for each of the
basic geometric transformations
AND
All transformations are specified in three
dimensions
Why?
Answer: Remember; OpenGL was developed as
3D library
But how to perform 2D transformations?
Answer: Set z = 0
93
2D Geometric Transformations
94. Basic OpenGL Geometric
Transformations
Translation
glTranslate* (tx, ty, tz);
* is either f or d
tx, ty and tz are any real number
For 2D, set tz=0.0
Rotation
glRotate* (theta, vx, vy, vz);
* is either f or d
theta is rotation angle in degrees (internally converted to
radian)
Vector v=(vx, vy, vz) defines the orientation for a rotation axis
that passes through the coordinate origin
For 2D, set vz=1.0 and vx=vy=0.0
94
2D Geometric Transformations
95. Basic OpenGL Geometric
Transformations (cont.)
Scaling
glScale* (sx, sy, sz);
* is either f or d
sx, sy and sz are any real number
Negative values generate reflection
Zero values can cause error because inverse matrix
cannot be calculated
All routines construct a 4x4 transformation
matrix
OpenGL uses composite matrices
Be careful with the order 95
2D Geometric Transformations
96. OpenGL Matrix Operations
glMatrixMode(.);
Projection Mode: Determines how the scene is
projected onto the screen
Modelview Mode: Used for storing and combining
geometric transformations
Texture Mode: Used for mapping texture patterns
to surfaces
Color Mode: Used to convert from one color mode
to another
96
2D Geometric Transformations
97. OpenGL Matrix Operations
Modelview matrix, used to store and combine
geometric transformations
glMatrixMode(GL_MODELVIEW);
A call to a transformation routine generates a
matrix that is multiplied by the current matrix
To assign the identity matrix to the current
matrix
glLoadIdentity();
97
2D Geometric Transformations
98. OpenGL Matrix Operations
(cont.)
Alternatively:
glLoadMatrix* (elements16);
To assign other values to the elements of the
current matrix
In column-major order:
First four elements in first column
Second four elements in second column
Third four elements in third column
Fourth four elements in fourth column
98
2D Geometric Transformations
99. OpenGL Matrix Operations
(cont.)
Concatenating a specified matrix with current
matrix:
glMultMatrix* (otherElements16);
Current matrix is postmultiplied (right-to-left) by
the specified matrix
Warning:
Matrix notation mjk means:
In OpenGL: j column, k row
In mathematics: j row, k column
99
2D Geometric Transformations
100. OpenGL Matrix Stacks
OpenGL maintains a matrix stack for
transformations
Initially the modelview stack contains only the
identity matrix
More about it:
Coming soon
100
2D Geometric Transformations
101. OpenGL Transformation Routines
For example, assume we want to do in the following
order:
translate by +2, -3, +4,
rotate by 450 around axis formed between origin and 1, 1, 1
scale with respect to the origin by 2 in each direction.
Our code would be
glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); //start with identity
glScalef(2.0,2.0,2.0); //Note: Start with the LAST operation
glRotatef(45.0,1.0,1.0,1.0);
glTranslatef(2.0,-3.0, 4.0); //End with the FIRST operation
101
2D Geometric Transformations
104. References
Donald Hearn, M. Pauline Baker, Warren R.
Carithers, “Computer Graphics with OpenGL, 4th
Edition”; Pearson, 2011
Sumanta Guha, “Computer Graphics Through
OpenGL: From Theory to Experiments”, CRC Press,
2010
Edward Angel, “Interactive Computer Graphics. A
Top-Down Approach Using OpenGL”, Addison-
Wesley, 2005
104
105. Ex. 1: Rotation of object about arbitrary point P (x, y) by θ
> Translate point (x, y) to origin
by (-x, -y)
> Rotate by θ
> Translate the point by (x, y)
108. 3 D - Rigid body transformations
Methods for object modeling transformation in three dimensions
are extended from two dimensional methods by including
consideration for the z coordinate.
Preserve lines, angles and distances.
# Generalize from 2D by including z
coordinate
# Straight forward for translation and
scale
# Rotation more difficult
# Homogeneous coordinates: 4
components
# Transformation matrices: 4×4
éléments.
109. 3D Point:
We will consider points as column vectors.
Thus, a typical point with coordinates (x, y, z) is
represented as:
3D Point Homogenous Coordinate:
A 3D point P is represented in homogeneous
coordinates by a 4-dim, Vector.
We don't lose anything.
The main advantage: it is easier to compose
translation and rotation.
Everything is matrix multiplication.
110. i. 3D Translation
In homogeneous coordinates, 3D transformations are represented by
4×4 matrixes:.
P is translated to P' by:
An object is translated in 3D
dimensional by transforming
each of the defining points of
the objects .
111. Cont’d…
# An object represented as a set of polygon surfaces, is translated by
translate each vertex of each surface and redraw the polygon
facets in the new position.
112. ii. 3D Rotation
In general, rotations are specified by a rotation axis and an angle.
In two-dimensions there is only one choice of a rotation axis that leaves
points in the plane.
The easiest rotation axes are those that parallel to the coordinate axis.
Positive rotation angles produce counterclockwise rotations about a
coordinate axis, if we are looking along the positive half of the axis
toward the coordinate origin.
118. iV. 3D Reflections
About an axis: equivalent to 180°rotation about that axis.
About a plane: A reflection through the xy plane.
A reflections through the xz and the yz planes are defined
similarly.
119. Exercise
You sat in the car, and find the side mirror 40mm on your
right and 30mm in your front. You started your car and drove
200mm forward, turned 30 degrees to right, moved 200mm
forward again, and turned 45 degrees to the right, and
stopped.
What is the position of the side mirror now, relative to where
you were sitting in the beginning?
120. Solution
# The side mirror position is locally (40, 30).
# The matrix of first driving forward 200mm is:
121. Cont’d…
The matrix to turn to the right 30 deg and 45 degrees
(rotating -30 and -45 degrees about the origin) are:
The 3rd transformation is moving
by 200mm along an axis oriented 60
degree with the x-axis.