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

Window to viewport transformation&matrix representation of homogeneous co...
Window to viewport transformation&matrix representation of homogeneous co...Window to viewport transformation&matrix representation of homogeneous co...
Window to viewport transformation&matrix representation of homogeneous co...Mani Kanth
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 
Raster scan system
Raster scan systemRaster scan system
Raster scan systemMohd Arif
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformationSelvakumar Gna
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithmAparna Joshi
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standardsMani Kanth
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithmMani Kanth
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curveArvind Kumar
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"Ankit Surti
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingArvind Kumar
 
Raster scan system & random scan system
Raster scan system & random scan systemRaster scan system & random scan system
Raster scan system & random scan systemshalinikarunakaran1
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversionMohd Arif
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer GraphicsLaxman Puri
 
Windows to viewport transformation
Windows to viewport transformationWindows to viewport transformation
Windows to viewport transformationPrashant Singh
 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clippingMani Kanth
 

What's hot (20)

Window to viewport transformation&matrix representation of homogeneous co...
Window to viewport transformation&matrix representation of homogeneous co...Window to viewport transformation&matrix representation of homogeneous co...
Window to viewport transformation&matrix representation of homogeneous co...
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
Raster scan system
Raster scan systemRaster scan system
Raster scan system
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standards
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curve
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
 
Raster scan system & random scan system
Raster scan system & random scan systemRaster scan system & random scan system
Raster scan system & random scan system
 
Windows and viewport
Windows and viewportWindows and viewport
Windows and viewport
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Windows to viewport transformation
Windows to viewport transformationWindows to viewport transformation
Windows to viewport transformation
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 

Viewers also liked

Surface representation
Surface representationSurface representation
Surface representationSunith Guraddi
 
Coons bicubic surface
Coons bicubic surfaceCoons bicubic surface
Coons bicubic surfaceramac123
 
Hermite bicubic-surface-patch
Hermite bicubic-surface-patchHermite bicubic-surface-patch
Hermite bicubic-surface-patchRohit Gothwal
 
Curves And Surfaces Representation And Application
Curves And Surfaces Representation And ApplicationCurves And Surfaces Representation And Application
Curves And Surfaces Representation And ApplicationDiaa ElKott
 
Cellular manufacturing and group technology
Cellular manufacturing and group technologyCellular manufacturing and group technology
Cellular manufacturing and group technologyHitendrasinh Zala
 
FLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEMFLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEMAnand Khare
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer GraphicsSanu Philip
 
Concurrent Engineering
Concurrent EngineeringConcurrent Engineering
Concurrent Engineeringajithsrc
 

Viewers also liked (12)

Clipping
ClippingClipping
Clipping
 
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
 
FLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEMFLEXIBLE MANUFACTURING SYSTEM
FLEXIBLE MANUFACTURING SYSTEM
 
Concurrent Engineering
Concurrent EngineeringConcurrent Engineering
Concurrent Engineering
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
Concurrent Engineering
Concurrent EngineeringConcurrent Engineering
Concurrent Engineering
 

Similar to Window to viewport transformation

Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewingRabin BK
 
Clipping CG ppt.pptx
Clipping CG ppt.pptxClipping CG ppt.pptx
Clipping CG ppt.pptxAamirSheikh49
 
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.pptxDolchandra
 
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.pptxDolchandra
 
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 TransitionsJean Vanderdonckt
 
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 ESPrabindh Sundareson
 
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.pdfVivekKumar148171
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphicsKALESHWAR KUMAR
 
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)Priscilla CPG
 
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.3Aswin John
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh Panchal
 
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💻 Anton Gerdelan
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfAmol Gaikwad
 
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 locusMIbrar4
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewingMohd Arif
 
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 2StanfordComputationalImaging
 
computer graphics
computer graphicscomputer graphics
computer graphicsMegabi Mamo
 

Similar to Window to viewport transformation (20)

Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
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
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 
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
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
 
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
 

More from Ankit Garg

Introduction to computer graphics part 2
Introduction to computer graphics part 2Introduction to computer graphics part 2
Introduction to computer graphics part 2Ankit Garg
 
Introduction to computer graphics part 1
Introduction to computer graphics part 1Introduction to computer graphics part 1
Introduction to computer graphics part 1Ankit Garg
 
Curve clipping
Curve clippingCurve clipping
Curve clippingAnkit Garg
 
Projection ppt
Projection pptProjection ppt
Projection pptAnkit Garg
 
Polygon filling
Polygon fillingPolygon filling
Polygon fillingAnkit Garg
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingAnkit Garg
 
Numerical unit 1
Numerical unit 1Numerical unit 1
Numerical unit 1Ankit Garg
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removalAnkit Garg
 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standardsAnkit Garg
 
Fractal introduction and applications modified version
Fractal introduction and applications modified versionFractal introduction and applications modified version
Fractal introduction and applications modified versionAnkit Garg
 
Digital image processing & computer graphics
Digital image processing & computer graphicsDigital image processing & computer graphics
Digital image processing & computer graphicsAnkit Garg
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination modelAnkit Garg
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithmAnkit Garg
 
Character generation
Character generationCharacter generation
Character generationAnkit Garg
 
Applications of cg
Applications of cgApplications of cg
Applications of cgAnkit Garg
 
2 d transformation
2 d transformation2 d transformation
2 d transformationAnkit Garg
 
3 d transformations
3 d transformations3 d transformations
3 d transformationsAnkit Garg
 

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 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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
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
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
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
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
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
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
(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
 

Recently uploaded (20)

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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
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
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
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...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
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
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
(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...
 

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