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

What's hot (20)

Back face detection
Back face detectionBack face detection
Back face detection
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
Raster scan system & random scan system
Raster scan system & random scan systemRaster scan system & random scan system
Raster scan system & random scan system
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
Windows to viewport transformation
Windows to viewport transformationWindows to viewport transformation
Windows to viewport transformation
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithm
 
Illumination Models & Shading
Illumination Models & ShadingIllumination Models & Shading
Illumination Models & Shading
 
Fixed point scaling
Fixed point scalingFixed point scaling
Fixed point scaling
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
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
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
fractals
fractalsfractals
fractals
 
Clipping
ClippingClipping
Clipping
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 

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 (14)

Clipping
ClippingClipping
Clipping
 
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
 
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
 
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
 
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
 
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
 

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

Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 

Recently uploaded (20)

Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 

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