SlideShare a Scribd company logo
Windowing I
• A scene is made up of a collection of objects specified in world
coordinates
World Coordinates
Windowing II
• When we display a scene only those objects within a particular
window are displayed
wymax
wymin
wxmin wxmax
Window
World Coordinates
Windowing III
• Because drawing things to a display takes time, we clip
everything outside the window
wymax
wymin
wxmin wxmax
World Coordinates
Window
Clipping Window
• We could design our own clipping window with any shape,
size and orientation.
• But clipping a scene using nonlinear boundaries requires more
processing than clipping against a rectangle.
• Therefore, graphics packages commonly allow only
rectangular clipping windows aligned with the x and y axes.
Window & Viewport
 Window/clipping window
 a world-coordinate area selected for display
 define what is to be viewed
 view port
 an area on a display device to which a window is
mapped
 define where it is to be displayed
Clipping Window
• clipping window: what to display
• viewport: where to be viewed
• translation, rotation, scaling, clipping,...
The viewing pipeline
The clipping window
xwmin xwmax
ywmin
ywmax
xvmin
xvmax
yvmin
yvmax
xvmin
xvmax
yvmin
yvmax
x0
y0
xview
yview
xworld
yworld
xview
yview
Rectangular
Window
Rotated
Window
Viewing Coord. Reference Frame
(a) translate the viewing origin to the world origin
(b) rotate to align the axes of the two systems.
World-coordinates to Viewing Coordinates
• Mwc,vc= R·T
x0
y0
xview
yview
xworld
yworld
xview
yview
xview
yview
xworld
yworld
yview
)
,
( 0
0 y
x 

T )
(
R

Mwc,vc= R·T
Window - Viewport Transform
• point (xw,yw) in a designated window is
mapped to viewport coordinates (xv,yv) so
that relative positions in the two areas are the
same.
Clipping Window -> Normalized Viewport
• To transform the world-coordinate point into the same relative
position within the viewport, we require that
min
max
min
min
max
min
min
max
min
min
max
min
yw
yw
yw
yw
yv
yv
yv
yv
xw
xw
xw
xw
xv
xv
xv
xv










For any point:
should hold.
  
  
min
max
min
max
min
min
min
max
min
max
min
min
yw
yw
yv
yv
yw
yw
+
yv
=
yv
xw
xw
xv
xv
xw
xw
+
xv
=
xv






• Solving these expressions for the viewport position (xv,yv) we
have:
where
)
(
)
(
min
min
min
min
yw
yw
s
yv
yv
xw
xw
s
xv
xv
y
x






min
max
min
max
min
max
min
max
yw
yw
yv
yv
s
xw
xw
xv
xv
s y
x






C
xw
s
xv
xw
s
xv
xw
s
xv
xw
s
xw
s
xv
xv
xw
xw
s
xv
xv
x
x
x
x
x
x











min)
min
min
min
min
min
(
)
(

































1
1
0
0
2
0
1
0
1
y
x
c
Sy
c
Sx
y
x
So The window to viewport transformation in matrix form can be
written as follows
When we solve it further we get…
)
(
)
(
min
min
min
min
yw
yw
s
yv
yv
xw
xw
s
xv
xv
y
x






• Note, if Sx = Sy then the relative proportions
of objects are maintained else the world
object will be stretched or contracted in either
x or y direction when displayed on output
device.
The complete window to viewport Transformation is a
compound transformation
That consists of the following 3 transformation.
• Translation on the window, to the origin i,e Tw
• Scaling i,e Sview
• Translation of scaled image to the place of the
Viewport, Tv
Clipping Window -> Normalized Viewport
• We could obtain the transformation from world coordinates to
viewport coordinates with the sequence (in reverse order):
1. Translate
2. Scale
3. translate










1
0
0
1
0
0
1
min
min
yv
xv










1
0
0
0
0
0
0
y
x
S
S












1
0
0
1
0
0
1
min
min
yw
xw
Clipping Window -> Normalized Viewport
• So VT = Tv * S view * T w
VT =










1
0
0
1
0
0
1
min
min
yv
xv










1
0
0
0
0
0
0
y
x
S
S












1
0
0
1
0
0
1
min
min
yw
xw

































1
1
0
0
2
0
1
0
1
y
x
c
Sy
c
Sx
y
x
Example Find the normalisation transformation N which uses the
rectangle W (1, 1), X (5, 3), Y (4, 5) and Z (0, 3) as a window and the
normalised device screen as the viewport.
• Here, we see that the window edges are not parallel to the
coordinate axes. So we will first rotate the window about W
so that it is aligned with the axes.
Here, we are rotating the rectangle in clockwise direction. So α is ( – )ve i.e., – α
The rotation matrix about W (1, 1) is,
2D viewing.ppt
2D viewing.ppt
2D viewing.ppt
2D viewing.ppt

More Related Content

Similar to 2D viewing.ppt

Windows and viewport
Windows and viewportWindows and viewport
Windows and viewport
Technology & Education
 
Introduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User GroupIntroduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User Group
bernice-chan
 
Introduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User GroupIntroduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User Group
dreambreeze
 
Intro to Canva
Intro to CanvaIntro to Canva
Intro to Canva
dreambreeze
 
Iagc2
Iagc2Iagc2
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithms
Rohit Jain
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
Ankit Garg
 
Lop1
Lop1Lop1
Unit 3
Unit 3Unit 3
Unit 3
ypnrao
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
VarthiniRamesh
 
Three dimensional concepts - Computer Graphics
Three dimensional concepts - Computer GraphicsThree dimensional concepts - Computer Graphics
Three dimensional concepts - Computer Graphics
Kongunadu College of engineering and Technology, Namakkal
 
canvas_1.pptx
canvas_1.pptxcanvas_1.pptx
canvas_1.pptx
RutujRunwal1
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
Gilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
Gilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
Gilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
Gilbert Guerrero
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motion
Gilbert Guerrero
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
MdAlAmin187
 

Similar to 2D viewing.ppt (18)

Windows and viewport
Windows and viewportWindows and viewport
Windows and viewport
 
Introduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User GroupIntroduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User Group
 
Introduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User GroupIntroduction to Canvas - Toronto HTML5 User Group
Introduction to Canvas - Toronto HTML5 User Group
 
Intro to Canva
Intro to CanvaIntro to Canva
Intro to Canva
 
Iagc2
Iagc2Iagc2
Iagc2
 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithms
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
 
Lop1
Lop1Lop1
Lop1
 
Unit 3
Unit 3Unit 3
Unit 3
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
 
Three dimensional concepts - Computer Graphics
Three dimensional concepts - Computer GraphicsThree dimensional concepts - Computer Graphics
Three dimensional concepts - Computer Graphics
 
canvas_1.pptx
canvas_1.pptxcanvas_1.pptx
canvas_1.pptx
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motion
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 

Recently uploaded

skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 

Recently uploaded (20)

skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 

2D viewing.ppt

  • 1. Windowing I • A scene is made up of a collection of objects specified in world coordinates World Coordinates
  • 2. Windowing II • When we display a scene only those objects within a particular window are displayed wymax wymin wxmin wxmax Window World Coordinates
  • 3. Windowing III • Because drawing things to a display takes time, we clip everything outside the window wymax wymin wxmin wxmax World Coordinates Window
  • 4. Clipping Window • We could design our own clipping window with any shape, size and orientation. • But clipping a scene using nonlinear boundaries requires more processing than clipping against a rectangle. • Therefore, graphics packages commonly allow only rectangular clipping windows aligned with the x and y axes.
  • 5. Window & Viewport  Window/clipping window  a world-coordinate area selected for display  define what is to be viewed  view port  an area on a display device to which a window is mapped  define where it is to be displayed
  • 6. Clipping Window • clipping window: what to display • viewport: where to be viewed • translation, rotation, scaling, clipping,...
  • 8. The clipping window xwmin xwmax ywmin ywmax xvmin xvmax yvmin yvmax xvmin xvmax yvmin yvmax x0 y0 xview yview xworld yworld xview yview Rectangular Window Rotated Window
  • 9.
  • 10. Viewing Coord. Reference Frame (a) translate the viewing origin to the world origin (b) rotate to align the axes of the two systems.
  • 11. World-coordinates to Viewing Coordinates • Mwc,vc= R·T x0 y0 xview yview xworld yworld xview yview xview yview xworld yworld yview ) , ( 0 0 y x   T ) ( R  Mwc,vc= R·T
  • 12. Window - Viewport Transform • point (xw,yw) in a designated window is mapped to viewport coordinates (xv,yv) so that relative positions in the two areas are the same.
  • 13. Clipping Window -> Normalized Viewport • To transform the world-coordinate point into the same relative position within the viewport, we require that min max min min max min min max min min max min yw yw yw yw yv yv yv yv xw xw xw xw xv xv xv xv           For any point: should hold.
  • 14.       min max min max min min min max min max min min yw yw yv yv yw yw + yv = yv xw xw xv xv xw xw + xv = xv       • Solving these expressions for the viewport position (xv,yv) we have: where ) ( ) ( min min min min yw yw s yv yv xw xw s xv xv y x       min max min max min max min max yw yw yv yv s xw xw xv xv s y x      
  • 16. • Note, if Sx = Sy then the relative proportions of objects are maintained else the world object will be stretched or contracted in either x or y direction when displayed on output device.
  • 17. The complete window to viewport Transformation is a compound transformation That consists of the following 3 transformation. • Translation on the window, to the origin i,e Tw • Scaling i,e Sview • Translation of scaled image to the place of the Viewport, Tv
  • 18. Clipping Window -> Normalized Viewport • We could obtain the transformation from world coordinates to viewport coordinates with the sequence (in reverse order): 1. Translate 2. Scale 3. translate           1 0 0 1 0 0 1 min min yv xv           1 0 0 0 0 0 0 y x S S             1 0 0 1 0 0 1 min min yw xw
  • 19. Clipping Window -> Normalized Viewport • So VT = Tv * S view * T w VT =           1 0 0 1 0 0 1 min min yv xv           1 0 0 0 0 0 0 y x S S             1 0 0 1 0 0 1 min min yw xw                                  1 1 0 0 2 0 1 0 1 y x c Sy c Sx y x
  • 20.
  • 21. Example Find the normalisation transformation N which uses the rectangle W (1, 1), X (5, 3), Y (4, 5) and Z (0, 3) as a window and the normalised device screen as the viewport.
  • 22. • Here, we see that the window edges are not parallel to the coordinate axes. So we will first rotate the window about W so that it is aligned with the axes. Here, we are rotating the rectangle in clockwise direction. So α is ( – )ve i.e., – α The rotation matrix about W (1, 1) is,