SlideShare a Scribd company logo
1 of 18
3D Scaling and Transformation in
Homogeneous Coordinates
In 3D graphics we are obviously dealing with a 3
Dimensional space; however, 3*3 matrices are not big
enough to allow for some of the transformations that we
want to perform, namely translation and perspective
projection.
In this presentation we are not dealing with the perspective
projection.
Translation
• If we consider a point (x,y) in a 2D plane and we want to
move it by dx in the x-axis and dy in the y-axis, we simply
do,
x’ = x + dx
y’ = y + dy
Moving into 3 dimensions is just as simple. In matrix form,
we can write
𝑑𝑥
𝑑𝑦
𝑑𝑧
+
𝑥
𝑦
𝑧
=
𝑑𝑥 + 𝑥
𝑑𝑦 + 𝑦
𝑑𝑧 + 𝑧
=
𝑥′
𝑦′
𝑧′
Scaling
If we consider a simple line segment of length 1 in 2D
space and we want to multiply it by n, we simply do,
x’ = x.n
y’ = y.n
Considering 3D scaling, in matrix form, the above
equations can be written as,
𝑆𝑥 0 0
0 𝑆𝑦 0
0 0 𝑆𝑧
*
𝑥
𝑦
𝑧
=
𝑆𝑥 ∗ 𝑥
𝑆𝑦 ∗ 𝑦
𝑆𝑧 ∗ 𝑧
Rotation
The mathematical definition of rotation is,
x’ = x.cos(t)-y.sin(t)
y’ = x.sin(t)+ y.cos(t)
This basically gives rise to following three matrices used to
perform rotations;
In the x-plane,
Rx =
1 0 0
0 cos(𝑡) − sin(𝑡)
0 sin(𝑡) cos 𝑡
In the y-plane,
cos(𝑡) 0 sin(𝑡)
0 1 0
−sin(𝑡) 0 cos(𝑡)
In the z-plane,
cos(𝑡) −sin(𝑡) 0
sin(𝑡) cos 𝑡 0
0 0 1
The application of any of these to our object in 3D space will
result in rotation in that direction.
cos(𝑡) −sin(𝑡) 0
sin(𝑡) cos 𝑡 0
0 0 1
∗
𝑥
𝑦
𝑧
=
𝑥. cos 𝑡 − 𝑦. sin(𝑡)
𝑥. sin 𝑡 + 𝑦. cos(𝑡)
𝑧
We know that a translation matrix can be combined with a
translation matrix, scaling matrix with a scaling matrix and a
rotation matrix with a rotation matrix. Since scaling and
rotation matrices are 3*3 matrices, they can be combined
as well, i.e. we can combine several scaling matrices with
several rotation matrices.
Translation matrices are additive in nature, therefore, we
can not combine translation matrices with scaling and
rotation matrices.
Combined
Transformation
• Combined transformation can be represented as
T(
𝑥
𝑦 ) =
𝑎 𝑏
𝑐 𝑑
∗
𝑥
𝑦 +
𝑒
𝑓
Where, a, b, c, d, e, f are scalars.
The above definition applies to 2D spaces, but is easily
increased to 3D spaces. Basically, applying the function T
to any object will translate, rotate and scale the object
accordingly.
Homogeneous
coordinates
The question arises here is where do homogenous
coordinates fit to all these. Basically, homogenous
coordinates allow combine transformations to be easily
represented by a matrix.
The conversion to homogenous transformation is quite
simple and allows for multiplication instead of addition
when dealing with translation.
Since 3*3 matrices are not big enough to allow some of the
transformation , therefore the trick is go for 4*4 matrices
that will help the transformation easy.
Scaling in terms of
homogeneous coordinates
• For making 4*4 matrices, we only need to add one extra
row and column. This will give us the scaling matrix as,












1000
000
000
000
Sz
Sy
Sx
Rotation in terms of
homogeneous coordinates
• For rotation we will use the matrices as follow:
In x- plane,













1000
0)cos()sin(0
0)sin()cos(0
0001
tt
tt
In y plane,
In z plane,











 
1000
0100
00)cos()sin(
00)sin()cos(
tt
tt













1000
0)cos(0)sin(
0010
0)sin(0)cos(
tt
tt
Representing a point using
homogeneous coordinates
Before understanding the translation in 4 dimensions, we first
need to be able to represent those points. We will do it like so,
by adding a 4th coordinate, w:
𝑥
𝑦
𝑧
𝑤
It is easy to see that ‘w’ is preserved in both the rotation and
scaling calculations. To find our original point we can simply use,
𝑥/𝑤
𝑦/𝑤
𝑧/𝑤
Hence we will often see w=1 which will represent a point in 3D
geometry.
Translation in
homogeneous coordinates
• Expanding the translation matrix to our new 4x4 size is a
bit tricky but if we have a good understanding of the
matrices we can figure it out.
• We don't want to multiply our point with a scalar; we
want to add something to it. So we must preserve the ( x,
y, z, w ) components. That's done by adding 1's in a
diagonal (identity matrix.).
• Next we want to add a scalar to the coordinates. Since
we have to multiply the matrices together in a ( xa + yb
+ zc + wd ) fashion we can use the fourth row. Making w
= 1 in our point we get the correct result ( x + d ).
Hence we get the translation matrix in homogenous
coordinates:












1000
100
010
001
dz
dy
dx
What happens if w ≠ 1 ?
• Well if w ≠ 1 then we can simply use our above calculation to
find out the point we are working with.
• Consider the following however,
[1 2 3 0.1]= [10 20 30 1]
[1 2 3 0.001]= [1000 2000 3000 1]
[1 2 3 0.000000001] = a point very far away.
• So that w tends to 0, we can start thinking about the point
very far away; i.e at infinity. For example when we use
lighting, we use w=1 to represent a positional light and w=0 to
represent directional light.
• This also allows us to represent vectors and scalars in the
same fashion, using w=1 represent a scalar value or a point
and w=0 to represent a vector in that direction.
References
• Notes
• (http://home10.inet.tele.dk/moelhave/tutors/3d/transform
ations/transformations.html)
• Homogeneous coordinates from Wikipedia, the free
encyclopedia
• Elementary Linear Algebra by Howard Anton and Chris
Rorres (Text book)
• Homogeneous Coordinates by Steve Land (2005 notes)
• Transformation matrices from DmWiki (DevMaster.net
Thankyou

More Related Content

What's hot

Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displaysSomya Bagai
 
Polygons - Computer Graphics - Notes
Polygons - Computer Graphics - NotesPolygons - Computer Graphics - Notes
Polygons - Computer Graphics - NotesOmprakash Chauhan
 
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit 2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath YogiTekendra Nath Yogi
 
regularized boolean set operations
regularized boolean set operationsregularized boolean set operations
regularized boolean set operationsHitesh Parmar
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curveArvind Kumar
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
Point processing
Point processingPoint processing
Point processingpanupriyaa7
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Iftikhar Ahmad
 
Homogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingHomogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingManthan Kanani
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphicssabbirantor
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligenceharshita virwani
 
Composite transformation
Composite transformationComposite transformation
Composite transformationPooja Dixit
 
Lecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image ProcessingLecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image ProcessingVARUN KUMAR
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 MicroprocessorNahian Ahmed
 
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm Aparna Joshi
 
Chapter 3
Chapter 3Chapter 3
Chapter 3PRADEEP
 
computer animation languages-N.Kavitha.pptx
computer animation languages-N.Kavitha.pptxcomputer animation languages-N.Kavitha.pptx
computer animation languages-N.Kavitha.pptxComputerScienceDepar6
 

What's hot (20)

Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 
3D Transformation
3D Transformation 3D Transformation
3D Transformation
 
Polygons - Computer Graphics - Notes
Polygons - Computer Graphics - NotesPolygons - Computer Graphics - Notes
Polygons - Computer Graphics - Notes
 
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit 2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit 2 By Tekendra Nath Yogi
 
regularized boolean set operations
regularized boolean set operationsregularized boolean set operations
regularized boolean set operations
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curve
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
Point processing
Point processingPoint processing
Point processing
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2
 
Homogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingHomogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearing
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligence
 
Composite transformation
Composite transformationComposite transformation
Composite transformation
 
Lecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image ProcessingLecture 16 KL Transform in Image Processing
Lecture 16 KL Transform in Image Processing
 
Types Of Buses
Types Of BusesTypes Of Buses
Types Of Buses
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
computer animation languages-N.Kavitha.pptx
computer animation languages-N.Kavitha.pptxcomputer animation languages-N.Kavitha.pptx
computer animation languages-N.Kavitha.pptx
 

Similar to 3 d scaling and translation in homogeneous coordinates

Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Xad Kuain
 
Triple_Integrals.pdf
Triple_Integrals.pdfTriple_Integrals.pdf
Triple_Integrals.pdfSalimSaleh9
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D2013901097
 
Reflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and RotationReflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and RotationSaumya Tiwari
 
2 d transformation
2 d transformation2 d transformation
2 d transformationAnkit Garg
 
Computer graphic
Computer graphicComputer graphic
Computer graphicnusratema1
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsBala Murali
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf ChicagoJanie Clayton
 
Mathematical blog #1
Mathematical blog #1Mathematical blog #1
Mathematical blog #1Steven Pauly
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformationSelvakumar Gna
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksJinTaek Seo
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 dxyz120
 
Section 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneSection 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneRob Poodiack
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerJanie Clayton
 

Similar to 3 d scaling and translation in homogeneous coordinates (20)

Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra
 
Triple_Integrals.pdf
Triple_Integrals.pdfTriple_Integrals.pdf
Triple_Integrals.pdf
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
 
Reflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and RotationReflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and Rotation
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Triple Integral
Triple IntegralTriple Integral
Triple Integral
 
Computer graphic
Computer graphicComputer graphic
Computer graphic
 
Complex numbers
Complex numbersComplex numbers
Complex numbers
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
 
Mathematical blog #1
Mathematical blog #1Mathematical blog #1
Mathematical blog #1
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
 
2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
 
Section 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate PlaneSection 1.3 -- The Coordinate Plane
Section 1.3 -- The Coordinate Plane
 
returika
returikareturika
returika
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 

Recently uploaded

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 

3 d scaling and translation in homogeneous coordinates

  • 1. 3D Scaling and Transformation in Homogeneous Coordinates
  • 2. In 3D graphics we are obviously dealing with a 3 Dimensional space; however, 3*3 matrices are not big enough to allow for some of the transformations that we want to perform, namely translation and perspective projection. In this presentation we are not dealing with the perspective projection.
  • 3. Translation • If we consider a point (x,y) in a 2D plane and we want to move it by dx in the x-axis and dy in the y-axis, we simply do, x’ = x + dx y’ = y + dy Moving into 3 dimensions is just as simple. In matrix form, we can write 𝑑𝑥 𝑑𝑦 𝑑𝑧 + 𝑥 𝑦 𝑧 = 𝑑𝑥 + 𝑥 𝑑𝑦 + 𝑦 𝑑𝑧 + 𝑧 = 𝑥′ 𝑦′ 𝑧′
  • 4. Scaling If we consider a simple line segment of length 1 in 2D space and we want to multiply it by n, we simply do, x’ = x.n y’ = y.n Considering 3D scaling, in matrix form, the above equations can be written as, 𝑆𝑥 0 0 0 𝑆𝑦 0 0 0 𝑆𝑧 * 𝑥 𝑦 𝑧 = 𝑆𝑥 ∗ 𝑥 𝑆𝑦 ∗ 𝑦 𝑆𝑧 ∗ 𝑧
  • 5. Rotation The mathematical definition of rotation is, x’ = x.cos(t)-y.sin(t) y’ = x.sin(t)+ y.cos(t) This basically gives rise to following three matrices used to perform rotations; In the x-plane, Rx = 1 0 0 0 cos(𝑡) − sin(𝑡) 0 sin(𝑡) cos 𝑡
  • 6. In the y-plane, cos(𝑡) 0 sin(𝑡) 0 1 0 −sin(𝑡) 0 cos(𝑡) In the z-plane, cos(𝑡) −sin(𝑡) 0 sin(𝑡) cos 𝑡 0 0 0 1 The application of any of these to our object in 3D space will result in rotation in that direction. cos(𝑡) −sin(𝑡) 0 sin(𝑡) cos 𝑡 0 0 0 1 ∗ 𝑥 𝑦 𝑧 = 𝑥. cos 𝑡 − 𝑦. sin(𝑡) 𝑥. sin 𝑡 + 𝑦. cos(𝑡) 𝑧
  • 7. We know that a translation matrix can be combined with a translation matrix, scaling matrix with a scaling matrix and a rotation matrix with a rotation matrix. Since scaling and rotation matrices are 3*3 matrices, they can be combined as well, i.e. we can combine several scaling matrices with several rotation matrices. Translation matrices are additive in nature, therefore, we can not combine translation matrices with scaling and rotation matrices.
  • 8. Combined Transformation • Combined transformation can be represented as T( 𝑥 𝑦 ) = 𝑎 𝑏 𝑐 𝑑 ∗ 𝑥 𝑦 + 𝑒 𝑓 Where, a, b, c, d, e, f are scalars. The above definition applies to 2D spaces, but is easily increased to 3D spaces. Basically, applying the function T to any object will translate, rotate and scale the object accordingly.
  • 9. Homogeneous coordinates The question arises here is where do homogenous coordinates fit to all these. Basically, homogenous coordinates allow combine transformations to be easily represented by a matrix. The conversion to homogenous transformation is quite simple and allows for multiplication instead of addition when dealing with translation. Since 3*3 matrices are not big enough to allow some of the transformation , therefore the trick is go for 4*4 matrices that will help the transformation easy.
  • 10. Scaling in terms of homogeneous coordinates • For making 4*4 matrices, we only need to add one extra row and column. This will give us the scaling matrix as,             1000 000 000 000 Sz Sy Sx
  • 11. Rotation in terms of homogeneous coordinates • For rotation we will use the matrices as follow: In x- plane,              1000 0)cos()sin(0 0)sin()cos(0 0001 tt tt
  • 12. In y plane, In z plane,              1000 0100 00)cos()sin( 00)sin()cos( tt tt              1000 0)cos(0)sin( 0010 0)sin(0)cos( tt tt
  • 13. Representing a point using homogeneous coordinates Before understanding the translation in 4 dimensions, we first need to be able to represent those points. We will do it like so, by adding a 4th coordinate, w: 𝑥 𝑦 𝑧 𝑤 It is easy to see that ‘w’ is preserved in both the rotation and scaling calculations. To find our original point we can simply use, 𝑥/𝑤 𝑦/𝑤 𝑧/𝑤 Hence we will often see w=1 which will represent a point in 3D geometry.
  • 14. Translation in homogeneous coordinates • Expanding the translation matrix to our new 4x4 size is a bit tricky but if we have a good understanding of the matrices we can figure it out. • We don't want to multiply our point with a scalar; we want to add something to it. So we must preserve the ( x, y, z, w ) components. That's done by adding 1's in a diagonal (identity matrix.). • Next we want to add a scalar to the coordinates. Since we have to multiply the matrices together in a ( xa + yb + zc + wd ) fashion we can use the fourth row. Making w = 1 in our point we get the correct result ( x + d ).
  • 15. Hence we get the translation matrix in homogenous coordinates:             1000 100 010 001 dz dy dx
  • 16. What happens if w ≠ 1 ? • Well if w ≠ 1 then we can simply use our above calculation to find out the point we are working with. • Consider the following however, [1 2 3 0.1]= [10 20 30 1] [1 2 3 0.001]= [1000 2000 3000 1] [1 2 3 0.000000001] = a point very far away. • So that w tends to 0, we can start thinking about the point very far away; i.e at infinity. For example when we use lighting, we use w=1 to represent a positional light and w=0 to represent directional light. • This also allows us to represent vectors and scalars in the same fashion, using w=1 represent a scalar value or a point and w=0 to represent a vector in that direction.
  • 17. References • Notes • (http://home10.inet.tele.dk/moelhave/tutors/3d/transform ations/transformations.html) • Homogeneous coordinates from Wikipedia, the free encyclopedia • Elementary Linear Algebra by Howard Anton and Chris Rorres (Text book) • Homogeneous Coordinates by Steve Land (2005 notes) • Transformation matrices from DmWiki (DevMaster.net