SlideShare a Scribd company logo
1 of 19
Module III
Window to viewport transformation
Total Slide
Ankit Garg
Assistant Professor
Amity University, Haryana
Window to viewport transformation
• Window port
• Viewport
• Window to Viewport mapping is required
• Some transformations are required
• Transformation can Translation, rotation,
scaling and shearing
Window to viewport transformation
• Window-to-Viewport mapping is the process of
mapping or transforming a two-dimensional, world-
coordinate scene to device coordinates. In particular,
objects inside the world or clipping window are
mapped to the viewport. The viewport is rectangular
area on screen where world coordinates are mapped
to be displayed.
• In other words, the clipping window is used to select
the part of the scene that is to be displayed. The
viewport is used to display selected portion of
window on the output device.
Window to viewport transformation
Window to viewport transformation
• Window port: A world coordinate area selected for display.
• View port: This is a rectangular region of the screen which is
selected for displaying the object. In other words we can say that view
port is part of computer screen.
• Window to Viewport Mapping- Mapping of a part of a world
coordinate scene to device coordinate is referred to as a viewing
transformation.
• Window to viewport transformation requires more than one
transformation.
Concept of window to viewport
transformation
• It may be possible that size of viewport is smaller
than size of window or greater than size of window.
• In this case we have to expand or decrease size of
window according to the size of viewport.
• In this concept same mapping is required to convert
size of window in size of view port.
• Some mathematical computations are required to
map window and viewport.
RM [4]-7
(wxmin,wymin)
(wxmax, wymax)
(vxmin, vymin)
(vxmax, vymax)
(x, y)
(u, v)
Window to Viewport Mapping
Steps for window to viewport transformation
• Step 1: Translate window towards origin
To shift window towards origin, lower left or
upper left corner of window will become (-).
Hence translation factor will become negative
(-tx,-ty).
(-wxL,-wyL) – When origin is lower left corner of
the screen.
(-wxL, -wyH)- When origin is upper left corner of
window.
Steps for window to viewport transformation (cont..)
• Step 2: Resize window to the size of view port.
To convert window size in to view port size
following computation is required.
• Step 3: Translate window (position of window
must be same as position of view port.
• If lower left corner of viewport is (0,0) we
don’t need to take step 3 because window
lower left corner is already shifted on origin
after taking first step.
• If lower left corner is not (0,0) we have to take
translation factor (+).
Steps for window to viewport transformation (cont..)
Steps for window to viewport transformation
Steps for window to viewport
transformation

Example
University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013

13
 Let us consider an example of view transformation.
 If our window has coordinates (10,10), (20,10), (20,20),
(10,20)
 Let our viewport coordinates are (.5,.5), (1,.5),(1,1), (.5,1)
 Take step 1: Translate window to origin
 In this case translation matrix will become
1 0 0
0 1 0
-10 -10 1
 Take step 2: convert size of window to viewport size
 sx=(1-0.5)/(11-1) 0.5/10  0.05
 sy=(1-0.5)/(11-1) 0.5/100.05

University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013

14
 so scaling transformation matrix will be
0.05 0 0
0 0.05 0
0 0 1
 Step 3: Finally window to position of view port
1 0 0
0 1 0
0.5 0.5 1
Example
Composition of transformations
– Translation toward origin
– Scaling
– Translation further from origin
.05 0 0
0 .05 0
0 0
1 0 0
0 1 0
1
1 0 0
0 1 0
.511 1 .5 1
 
 
 

 
 
 

 
 
 
    − − 
QUESTION
• Window coordinates are (0,0), (2,0), (2,2), (0,2).
• View port coordinates are (0,0), (4,0), (4,4), (0,4).
1.Find out relative position of coordinate (1,1) of
window in viewport.
2. Calculate scaling factor for this transformation
3. Write down all three transformation matrix for
this viewing transformation.
Formula to find relative position
xv = xvmin + (xw - xwmin)sx
yv = yvmin + (yw - ywmin)sy
Formula to find out scaling factor
Sx= width of viewport / width of window
Sy= height of viwport / height of window
Program on Window to Viewport Transformation
THANKS

More Related Content

What's hot

Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
Mohd Arif
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
Mohd Arif
 

What's hot (20)

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
Raster scan system & random scan system
Raster scan system & random scan systemRaster scan system & random scan system
Raster scan system & random scan system
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPTHOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
Notes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphicsNotes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphics
 
Illumination Models & Shading
Illumination Models & ShadingIllumination Models & Shading
Illumination Models & Shading
 
Segments in Graphics
Segments in GraphicsSegments in Graphics
Segments in Graphics
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Composite transformation
Composite transformationComposite transformation
Composite transformation
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
Clipping
ClippingClipping
Clipping
 

Viewers also liked (14)

Clipping
ClippingClipping
Clipping
 
Windows to viewport transformation
Windows to viewport transformationWindows to viewport transformation
Windows to viewport transformation
 
Windows and viewport
Windows and viewportWindows and viewport
Windows and viewport
 
Surface representation
Surface representationSurface representation
Surface representation
 
Coons bicubic surface
Coons bicubic surfaceCoons bicubic surface
Coons bicubic surface
 
Hermite bicubic-surface-patch
Hermite bicubic-surface-patchHermite bicubic-surface-patch
Hermite bicubic-surface-patch
 
Curves And Surfaces Representation And Application
Curves And Surfaces Representation And ApplicationCurves And Surfaces Representation And Application
Curves And Surfaces Representation And Application
 
B spline
B splineB spline
B spline
 
Group Technology
Group TechnologyGroup Technology
Group Technology
 
Cellular manufacturing and group technology
Cellular manufacturing and group technologyCellular manufacturing and group technology
Cellular manufacturing and group technology
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
FLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEMFLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEM
 
Concurrent Engineering
Concurrent EngineeringConcurrent Engineering
Concurrent Engineering
 
Concurrent Engineering
Concurrent EngineeringConcurrent Engineering
Concurrent Engineering
 

Similar to Window to viewport transformation

Window to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptxWindow to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptx
Dolchandra
 
Showing User Interface Adaptivity by Animated Transitions
Showing User Interface Adaptivity by Animated TransitionsShowing User Interface Adaptivity by Animated Transitions
Showing User Interface Adaptivity by Animated Transitions
Jean Vanderdonckt
 
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdfUNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
VivekKumar148171
 
computer graphics
computer graphicscomputer graphics
computer graphics
Megabi Mamo
 

Similar to Window to viewport transformation (20)

Clipping CG ppt.pptx
Clipping CG ppt.pptxClipping CG ppt.pptx
Clipping CG ppt.pptx
 
Window to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptxWindow to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptx
 
Window to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptxWindow to Viewport Transformation in Computer Graphics with.pptx
Window to Viewport Transformation in Computer Graphics with.pptx
 
Showing User Interface Adaptivity by Animated Transitions
Showing User Interface Adaptivity by Animated TransitionsShowing User Interface Adaptivity by Animated Transitions
Showing User Interface Adaptivity by Animated Transitions
 
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
GFX Part 5 - Introduction to Object Transformations in OpenGL ESGFX Part 5 - Introduction to Object Transformations in OpenGL ES
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
 
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdfUNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
 
CAD - Unit-1 (Fundamentals of Computer Graphics)
CAD - Unit-1 (Fundamentals of Computer Graphics)CAD - Unit-1 (Fundamentals of Computer Graphics)
CAD - Unit-1 (Fundamentals of Computer Graphics)
 
Gocad Tutorial
Gocad TutorialGocad Tutorial
Gocad Tutorial
 
What you need to know about FEMAP v11.3
What you need to know about FEMAP v11.3What you need to know about FEMAP v11.3
What you need to know about FEMAP v11.3
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Flow chart programming
Flow chart programmingFlow chart programming
Flow chart programming
 
Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshare
 
Computer Graphics - Lecture 03 - Virtual Cameras and the Transformation Pipeline
Computer Graphics - Lecture 03 - Virtual Cameras and the Transformation PipelineComputer Graphics - Lecture 03 - Virtual Cameras and the Transformation Pipeline
Computer Graphics - Lecture 03 - Virtual Cameras and the Transformation Pipeline
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdf
 
Compensator Design and parameters modification using Bode plot and root locus
Compensator Design and parameters modification using Bode plot and root locusCompensator Design and parameters modification using Bode plot and root locus
Compensator Design and parameters modification using Bode plot and root locus
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
Unit 4 notes
Unit 4 notesUnit 4 notes
Unit 4 notes
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
 
Post rendering
Post renderingPost rendering
Post rendering
 

More from Ankit Garg (20)

Introduction to computer graphics part 2
Introduction to computer graphics part 2Introduction to computer graphics part 2
Introduction to computer graphics part 2
 
Introduction to computer graphics part 1
Introduction to computer graphics part 1Introduction to computer graphics part 1
Introduction to computer graphics part 1
 
Curve clipping
Curve clippingCurve clipping
Curve clipping
 
Unit 1
Unit 1Unit 1
Unit 1
 
Projection ppt
Projection pptProjection ppt
Projection ppt
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Numerical unit 1
Numerical unit 1Numerical unit 1
Numerical unit 1
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Line clipping
Line clippingLine clipping
Line clipping
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standards
 
Fractal introduction and applications modified version
Fractal introduction and applications modified versionFractal introduction and applications modified version
Fractal introduction and applications modified version
 
Digital image processing & computer graphics
Digital image processing & computer graphicsDigital image processing & computer graphics
Digital image processing & computer graphics
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
Character generation
Character generationCharacter generation
Character generation
 
Applications of cg
Applications of cgApplications of cg
Applications of cg
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
3 d transformations
3 d transformations3 d transformations
3 d transformations
 

Recently uploaded

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Recently uploaded (20)

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 

Window to viewport transformation

  • 1. Module III Window to viewport transformation Total Slide Ankit Garg Assistant Professor Amity University, Haryana
  • 2. Window to viewport transformation • Window port • Viewport • Window to Viewport mapping is required • Some transformations are required • Transformation can Translation, rotation, scaling and shearing
  • 3. Window to viewport transformation • Window-to-Viewport mapping is the process of mapping or transforming a two-dimensional, world- coordinate scene to device coordinates. In particular, objects inside the world or clipping window are mapped to the viewport. The viewport is rectangular area on screen where world coordinates are mapped to be displayed. • In other words, the clipping window is used to select the part of the scene that is to be displayed. The viewport is used to display selected portion of window on the output device.
  • 4. Window to viewport transformation
  • 5. Window to viewport transformation • Window port: A world coordinate area selected for display. • View port: This is a rectangular region of the screen which is selected for displaying the object. In other words we can say that view port is part of computer screen. • Window to Viewport Mapping- Mapping of a part of a world coordinate scene to device coordinate is referred to as a viewing transformation. • Window to viewport transformation requires more than one transformation.
  • 6. Concept of window to viewport transformation • It may be possible that size of viewport is smaller than size of window or greater than size of window. • In this case we have to expand or decrease size of window according to the size of viewport. • In this concept same mapping is required to convert size of window in size of view port. • Some mathematical computations are required to map window and viewport.
  • 7. RM [4]-7 (wxmin,wymin) (wxmax, wymax) (vxmin, vymin) (vxmax, vymax) (x, y) (u, v) Window to Viewport Mapping
  • 8. Steps for window to viewport transformation • Step 1: Translate window towards origin To shift window towards origin, lower left or upper left corner of window will become (-). Hence translation factor will become negative (-tx,-ty). (-wxL,-wyL) – When origin is lower left corner of the screen. (-wxL, -wyH)- When origin is upper left corner of window.
  • 9. Steps for window to viewport transformation (cont..) • Step 2: Resize window to the size of view port. To convert window size in to view port size following computation is required.
  • 10. • Step 3: Translate window (position of window must be same as position of view port. • If lower left corner of viewport is (0,0) we don’t need to take step 3 because window lower left corner is already shifted on origin after taking first step. • If lower left corner is not (0,0) we have to take translation factor (+). Steps for window to viewport transformation (cont..)
  • 11. Steps for window to viewport transformation
  • 12. Steps for window to viewport transformation
  • 13.  Example University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013  13  Let us consider an example of view transformation.  If our window has coordinates (10,10), (20,10), (20,20), (10,20)  Let our viewport coordinates are (.5,.5), (1,.5),(1,1), (.5,1)  Take step 1: Translate window to origin  In this case translation matrix will become 1 0 0 0 1 0 -10 -10 1  Take step 2: convert size of window to viewport size  sx=(1-0.5)/(11-1) 0.5/10  0.05  sy=(1-0.5)/(11-1) 0.5/100.05
  • 14.  University of sulaimanyiah - Faculty of Physical and Basic Education - Computer Dep. 2012-2013  14  so scaling transformation matrix will be 0.05 0 0 0 0.05 0 0 0 1  Step 3: Finally window to position of view port 1 0 0 0 1 0 0.5 0.5 1 Example
  • 15. Composition of transformations – Translation toward origin – Scaling – Translation further from origin .05 0 0 0 .05 0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 .511 1 .5 1                         − − 
  • 16. QUESTION • Window coordinates are (0,0), (2,0), (2,2), (0,2). • View port coordinates are (0,0), (4,0), (4,4), (0,4). 1.Find out relative position of coordinate (1,1) of window in viewport. 2. Calculate scaling factor for this transformation 3. Write down all three transformation matrix for this viewing transformation.
  • 17. Formula to find relative position xv = xvmin + (xw - xwmin)sx yv = yvmin + (yw - ywmin)sy Formula to find out scaling factor Sx= width of viewport / width of window Sy= height of viwport / height of window
  • 18. Program on Window to Viewport Transformation