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
2D viewing.ppt
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
2D viewing.ppt
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

PPTX
Clipping CG ppt.pptx
PPT
Window to viewport transformation
PPT
Two dimensional viewing
PPTX
Window to viewport transformation&matrix representation of homogeneous co...
PPTX
Window to Viewport Transformation in Computer Graphics with.pptx
PPTX
Window to Viewport Transformation in Computer Graphics with.pptx
PDF
Lec08112004.pdf
PPTX
Windows to viewport transformation
Clipping CG ppt.pptx
Window to viewport transformation
Two dimensional viewing
Window to viewport transformation&matrix representation of homogeneous co...
Window to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptx
Lec08112004.pdf
Windows to viewport transformation

Similar to 2D viewing.ppt (20)

PDF
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
PPTX
Viewing transformation
PPTX
UNIT_3-Two-Dimensional-Geometric-Transformations.pptx
PDF
Unit 3
PPT
Windows and viewport
PPT
3 d modeling part 1
PPTX
2 d viewing computer graphics
PDF
Lect7 viewing in2d
PPTX
Graphics_3D viewing
PPTX
CHAPTER - 4 for software engineering (1).pptx
PPT
Three dimensional concepts - Computer Graphics
PPTX
UNIT 1 2dviewing of image151213164537.pptx
PPTX
Clipping
PPTX
Bhavesh window clipping slidshare
PPTX
2D Viewinrrrrrdddfddddffdrrrdddfdsssg.pptx
PPT
PPTX
01. Introduction.pptx
PDF
Clipping
PPT
Drawing Tools
PPTX
UNIT-III
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
Viewing transformation
UNIT_3-Two-Dimensional-Geometric-Transformations.pptx
Unit 3
Windows and viewport
3 d modeling part 1
2 d viewing computer graphics
Lect7 viewing in2d
Graphics_3D viewing
CHAPTER - 4 for software engineering (1).pptx
Three dimensional concepts - Computer Graphics
UNIT 1 2dviewing of image151213164537.pptx
Clipping
Bhavesh window clipping slidshare
2D Viewinrrrrrdddfddddffdrrrdddfdsssg.pptx
01. Introduction.pptx
Clipping
Drawing Tools
UNIT-III
Ad

Recently uploaded (20)

PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
advance database management system book.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Introduction to Building Materials
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Trump Administration's workforce development strategy
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
What if we spent less time fighting change, and more time building what’s rig...
advance database management system book.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Introduction to Building Materials
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
AI-driven educational solutions for real-life interventions in the Philippine...
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
My India Quiz Book_20210205121199924.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
TNA_Presentation-1-Final(SAVE)) (1).pptx
Paper A Mock Exam 9_ Attempt review.pdf.
Trump Administration's workforce development strategy
Ad

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
  • 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
  • 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,