SlideShare uma empresa Scribd logo
1 de 18
It is a formal mechanism for displaying views
of a picture on an output device. A graphics
package allows the user to specify
a) Which part of the defined picture is to be
     displayed.
b) Where the part is to be placed on the
     display device.
Much like what we see in real life through a
small window or the view finder of a camera.
Objects are placed into the scene by modeling
   transformation to a master coordinate
   system, referred to as world coordinate
   system (WCS).
A WCS area selected for display is called
   window. The window defines what is to be
   viewed. Window is a rectangle finite
   region whose edges are parallel to the
   WCS.
Sometimes an additional coordinate system
called a viewing coordinate system is
introduced to show the effect of moving view.
Window




          World Coordinate System
An image representing a view often becomes
part of a larger image, like a photo on an
album page. Since album pages vary &
monitor size differs from one system to
another, so we want to introduce a device
independent tool to describe the display area,
called normalized device coordinate system
(NDCS) in which virtual display device’s area
is (1 x 1)square & lower left corner is at
    origin
(0,0) of the coordinate system.
The area on a display device to which a
    window is mapped is called a viewport.
    The viewport defines where the view is to
    be displayed. The rectangle viewport with
    its edges parallel to the axes of the NDCS
1      Viewport           Workstation
                                  Window



      0,0
            Normalized device 1
            Coordinate System


The process to convert object coordinate in
WCS to NDCS is called window to viewport
mapping or normalized transformation.
The process that maps NDCS to discrete
device/image coordinate is called
workstation transformation.

                                Workstation
                                Viewport




      Device/Image co-ordinate System
Which is a 2nd window to viewport mapping
with a workstation window in NDCS &
workstation viewport in device coordinate
system. These two coordinate mapping
Opn. refers to as viewing transformation.
Window to Viewport Transformation
Once object description have been transferred
  to the viewing reference frame, we choose
  the window extents in viewing coordinate
  & select the viewport limit in normalized
  coordinates. Object description are then
  transferred to normalized device coordinate
This can be done by using the transformation
  that maintain the same relative placement
  of object in normalized space as they had
  in viewing coordinates.
For eg.- if a coordinate position is at center of
    the viewing window, it will be displayed at
    the center of the viewport.
            (xw,yw)                  (xv,yv)
ywmax
                          yvmax


ywmin                     yvmin


         xwmin         xwmax      xvmin        xvmax
                 WCS                  NDCS
The objective of window to viewport mapping
  is to convert the world coordinate (wx,wy)
  of an arbitrary point to its corresponding
  normalized device coordinate (vx,vy). In
  order to maintain the same relative
  placement of point in the viewport as in the
  window, we require
      wx – wxmin    =     vx – vxmin --(1)
     wxmax – wxmin    vxmax - vxmin
wy – wymin     =      vy – vymin --(2)
     wymax – wymin       vymax – vymin

Solving these expressions for the viewport
  position vx & vy we have
   vx = vxmax – vxmin (wx – wxmin) + vx min
         wxmax – wxmin
   vx = Sx (wx – wxmin) + vx min
   Sx = vxmax – vxmin
         wxmax – wxmin
From (2)
  vy = vymax – vymin (wy – wymin) + vy min
          wymax – wymin
  vy = Sy (wy – wymin) + vy min
 Sy =     vymax – vymin
          wymax – wymin
Since the eight coordinate values that define
the window & the viewport are just constant,
we can express these two formulas for
computing (vx,vy) from (wx,wy) in terms of
translate-scale-translate transformation N.
vx           wx
           vy     = N . wy
            1           1
Where
 N = 1 0 vxmin      sx 0 0   1 0 -wxmin
      0 1 vymin     0 sy 0   0 1 -wymin
       0 0     1     0 0 1    0 0     1
Put the value of sx & sy.
Ques-1 Find the normalization transformation
     that maps a window whose lower left
     corner is at (1,1) & upper right corner is at
     (3,5) onto
(i) Viewport that is entire normalized device
     screen.
(ii) A viewport that has lower left corner at
     (0,0) & upper right corner at (1/2,1/2).
Solution: (i) wxmin = 1    wymin = 1
      wxmax = 3    wymax = 5
vxmin = 0 vymin = 0
           vxmax = 1 vymax = 1
Sx = vxmax – vxmin = 1 – 0       =1
      wxmax – wxmin 3 - 1        2
Sy = vymax – vymin = 1 - 0 = 1
     wymax – wymin 5 - 1         4
N= 1 0 0         ½ 0 0           1 0 -1
   0 1 0         0 ¼ 0           0 1 -1
   0 0 1         0 0 1           0 0 1
= ½ 0 -1/2
                0 ¼ -1/4
                0 0    1
(ii)        wxmin = 1 wymin = 1
       wxmax = 3        wymax = 5
            vxmin = 0        vymin = 0
            vxmax = 1/2       vymax = 1/2
Sx = ½ - 0         = ½      = ¼
     3- 1            2
Sy =  ½ -0 = ½        =   1/8
      5 -1     4
N = 1 0 0 1/4 0       0     1 0 -1
    0 1 0     0 1/8   0     0 1 -1
    0 0 1     0 0     1     0 0 1
   ¼    0 -1/4
= 0 1/8 -1/8
   0   0    1
Ques-2 Find the normalized transformation
    that maps a window whose lower left
    corner is at (2,2) & upper right corner is at
    (3,4) onto
(a) A viewport that is the entire normalized
    device screen and
(b) A viewport that has lowerleft corner at
    (0,0) and upper left corner (3/2,3/2).

Mais conteúdo relacionado

Mais procurados

Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output PrimitivesRenita Santhmayora
 
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
 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clippingMani Kanth
 
Video display devices
Video display devicesVideo display devices
Video display devicesMohd Arif
 
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 PPTAhtesham Ullah khan
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingArvind Kumar
 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphicsShaishavShah8
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphicsKALESHWAR KUMAR
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
Composite transformations
Composite transformationsComposite transformations
Composite transformationsMohd Arif
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingMohd Arif
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clippingMdAlAmin187
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfacesAnkur Kumar
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithmAparna Joshi
 

Mais procurados (20)

Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
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...
 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
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
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphics
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
Clipping
ClippingClipping
Clipping
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
Spline representations
Spline representationsSpline representations
Spline representations
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
 
Three dimensional concepts - Computer Graphics
Three dimensional concepts - Computer GraphicsThree dimensional concepts - Computer Graphics
Three dimensional concepts - Computer Graphics
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
Clipping
ClippingClipping
Clipping
 

Destaque

Windows to viewport transformation
Windows to viewport transformationWindows to viewport transformation
Windows to viewport transformationPrashant Singh
 
Viewing transformation
Viewing transformationViewing transformation
Viewing transformationUdayan Gupta
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clippingavelraj
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformationsMohammad Sadiq
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer GraphicsLaxman Puri
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)Amit Kapoor
 
Clipping Algorithm In Computer Graphics
Clipping Algorithm In Computer GraphicsClipping Algorithm In Computer Graphics
Clipping Algorithm In Computer Graphicsstudent(MCA)
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
Cohen-sutherland & liang-basky line clipping algorithm
Cohen-sutherland & liang-basky line clipping algorithmCohen-sutherland & liang-basky line clipping algorithm
Cohen-sutherland & liang-basky line clipping algorithmShilpa Hait
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithmMohamed El-Serngawy
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algoMohd Arif
 
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 graphicsNANDINI SHARMA
 
Cohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping AlgorithmCohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping AlgorithmMaruf Abdullah (Rion)
 

Destaque (20)

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
 
Clipping
ClippingClipping
Clipping
 
Viewing transformation
Viewing transformationViewing transformation
Viewing transformation
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformations
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Curve clipping
Curve clippingCurve clipping
Curve clipping
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Clipping Algorithm In Computer Graphics
Clipping Algorithm In Computer GraphicsClipping Algorithm In Computer Graphics
Clipping Algorithm In Computer Graphics
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Cohen-sutherland & liang-basky line clipping algorithm
Cohen-sutherland & liang-basky line clipping algorithmCohen-sutherland & liang-basky line clipping algorithm
Cohen-sutherland & liang-basky line clipping algorithm
 
Clipping
ClippingClipping
Clipping
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algo
 
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
 
Cohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping AlgorithmCohen-Sutherland Line Clipping Algorithm
Cohen-Sutherland Line Clipping Algorithm
 

Semelhante a Two dimensional viewing

Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewingRabin BK
 
Trident International Graphics Workshop 2014 2/5
Trident International Graphics Workshop 2014 2/5Trident International Graphics Workshop 2014 2/5
Trident International Graphics Workshop 2014 2/5Takao Wada
 
computer graphics
computer graphicscomputer graphics
computer graphicsMegabi Mamo
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEThiyagarajan G
 
6. Perspective Projection .pdf
6. Perspective  Projection                    .pdf6. Perspective  Projection                    .pdf
6. Perspective Projection .pdfYatruHarshaHiski
 
Computer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdfComputer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdfAOUNHAIDER7
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerJanie Clayton
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniyaTutorialsDuniya.com
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Three dimensional geometric transformations
Three dimensional geometric transformationsThree dimensional geometric transformations
Three dimensional geometric transformationsshanthishyam
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 

Semelhante a Two dimensional viewing (20)

Lec08112004.pdf
Lec08112004.pdfLec08112004.pdf
Lec08112004.pdf
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
2D viewing.ppt
2D viewing.ppt2D viewing.ppt
2D viewing.ppt
 
OpenVX 1.3 Reference Guide
OpenVX 1.3 Reference GuideOpenVX 1.3 Reference Guide
OpenVX 1.3 Reference Guide
 
Trident International Graphics Workshop 2014 2/5
Trident International Graphics Workshop 2014 2/5Trident International Graphics Workshop 2014 2/5
Trident International Graphics Workshop 2014 2/5
 
OpenVX 1.2 Reference Guide
OpenVX 1.2 Reference GuideOpenVX 1.2 Reference Guide
OpenVX 1.2 Reference Guide
 
OpenVX 1.1 Reference Guide
OpenVX 1.1 Reference GuideOpenVX 1.1 Reference Guide
OpenVX 1.1 Reference Guide
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
 
6. Perspective Projection .pdf
6. Perspective  Projection                    .pdf6. Perspective  Projection                    .pdf
6. Perspective Projection .pdf
 
Drawing Tools
Drawing ToolsDrawing Tools
Drawing Tools
 
Computer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdfComputer Graphics Notes 2.pdf
Computer Graphics Notes 2.pdf
 
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
Csc406 lecture7 device independence and normalization in Computer graphics(Co...Csc406 lecture7 device independence and normalization in Computer graphics(Co...
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniya
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Maps
MapsMaps
Maps
 
OpenVX 1.0 Reference Guide
OpenVX 1.0 Reference GuideOpenVX 1.0 Reference Guide
OpenVX 1.0 Reference Guide
 
Three dimensional geometric transformations
Three dimensional geometric transformationsThree dimensional geometric transformations
Three dimensional geometric transformations
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 

Mais de Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcpMohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarpMohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Project identification
Project identificationProject identification
Project identificationMohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniquesMohd Arif
 
Presentation
PresentationPresentation
PresentationMohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in cMohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peerMohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systemsMohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdpMohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgetingMohd Arif
 
Network management
Network managementNetwork management
Network managementMohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basicsMohd Arif
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformMohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and sslMohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psecMohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardwareMohd Arif
 

Mais de Mohd Arif (20)

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Project identification
Project identificationProject identification
Project identification
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
 
Presentation
PresentationPresentation
Presentation
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
 
Network management
Network managementNetwork management
Network management
 
Networing basics
Networing basicsNetworing basics
Networing basics
 
Loaders
LoadersLoaders
Loaders
 
Lists
ListsLists
Lists
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
 
Heap sort
Heap sortHeap sort
Heap sort
 

Two dimensional viewing

  • 1. It is a formal mechanism for displaying views of a picture on an output device. A graphics package allows the user to specify a) Which part of the defined picture is to be displayed. b) Where the part is to be placed on the display device. Much like what we see in real life through a small window or the view finder of a camera.
  • 2. Objects are placed into the scene by modeling transformation to a master coordinate system, referred to as world coordinate system (WCS). A WCS area selected for display is called window. The window defines what is to be viewed. Window is a rectangle finite region whose edges are parallel to the WCS. Sometimes an additional coordinate system called a viewing coordinate system is introduced to show the effect of moving view.
  • 3. Window World Coordinate System An image representing a view often becomes part of a larger image, like a photo on an album page. Since album pages vary & monitor size differs from one system to another, so we want to introduce a device
  • 4. independent tool to describe the display area, called normalized device coordinate system (NDCS) in which virtual display device’s area is (1 x 1)square & lower left corner is at origin (0,0) of the coordinate system. The area on a display device to which a window is mapped is called a viewport. The viewport defines where the view is to be displayed. The rectangle viewport with its edges parallel to the axes of the NDCS
  • 5. 1 Viewport Workstation Window 0,0 Normalized device 1 Coordinate System The process to convert object coordinate in WCS to NDCS is called window to viewport mapping or normalized transformation.
  • 6. The process that maps NDCS to discrete device/image coordinate is called workstation transformation. Workstation Viewport Device/Image co-ordinate System
  • 7. Which is a 2nd window to viewport mapping with a workstation window in NDCS & workstation viewport in device coordinate system. These two coordinate mapping Opn. refers to as viewing transformation.
  • 8. Window to Viewport Transformation Once object description have been transferred to the viewing reference frame, we choose the window extents in viewing coordinate & select the viewport limit in normalized coordinates. Object description are then transferred to normalized device coordinate This can be done by using the transformation that maintain the same relative placement of object in normalized space as they had in viewing coordinates.
  • 9. For eg.- if a coordinate position is at center of the viewing window, it will be displayed at the center of the viewport. (xw,yw) (xv,yv) ywmax yvmax ywmin yvmin xwmin xwmax xvmin xvmax WCS NDCS
  • 10. The objective of window to viewport mapping is to convert the world coordinate (wx,wy) of an arbitrary point to its corresponding normalized device coordinate (vx,vy). In order to maintain the same relative placement of point in the viewport as in the window, we require wx – wxmin = vx – vxmin --(1) wxmax – wxmin vxmax - vxmin
  • 11. wy – wymin = vy – vymin --(2) wymax – wymin vymax – vymin Solving these expressions for the viewport position vx & vy we have vx = vxmax – vxmin (wx – wxmin) + vx min wxmax – wxmin vx = Sx (wx – wxmin) + vx min Sx = vxmax – vxmin wxmax – wxmin
  • 12. From (2) vy = vymax – vymin (wy – wymin) + vy min wymax – wymin vy = Sy (wy – wymin) + vy min Sy = vymax – vymin wymax – wymin Since the eight coordinate values that define the window & the viewport are just constant, we can express these two formulas for computing (vx,vy) from (wx,wy) in terms of translate-scale-translate transformation N.
  • 13. vx wx vy = N . wy 1 1 Where N = 1 0 vxmin sx 0 0 1 0 -wxmin 0 1 vymin 0 sy 0 0 1 -wymin 0 0 1 0 0 1 0 0 1 Put the value of sx & sy.
  • 14. Ques-1 Find the normalization transformation that maps a window whose lower left corner is at (1,1) & upper right corner is at (3,5) onto (i) Viewport that is entire normalized device screen. (ii) A viewport that has lower left corner at (0,0) & upper right corner at (1/2,1/2). Solution: (i) wxmin = 1 wymin = 1 wxmax = 3 wymax = 5
  • 15. vxmin = 0 vymin = 0 vxmax = 1 vymax = 1 Sx = vxmax – vxmin = 1 – 0 =1 wxmax – wxmin 3 - 1 2 Sy = vymax – vymin = 1 - 0 = 1 wymax – wymin 5 - 1 4 N= 1 0 0 ½ 0 0 1 0 -1 0 1 0 0 ¼ 0 0 1 -1 0 0 1 0 0 1 0 0 1
  • 16. = ½ 0 -1/2 0 ¼ -1/4 0 0 1 (ii) wxmin = 1 wymin = 1 wxmax = 3 wymax = 5 vxmin = 0 vymin = 0 vxmax = 1/2 vymax = 1/2 Sx = ½ - 0 = ½ = ¼ 3- 1 2
  • 17. Sy = ½ -0 = ½ = 1/8 5 -1 4 N = 1 0 0 1/4 0 0 1 0 -1 0 1 0 0 1/8 0 0 1 -1 0 0 1 0 0 1 0 0 1 ¼ 0 -1/4 = 0 1/8 -1/8 0 0 1
  • 18. Ques-2 Find the normalized transformation that maps a window whose lower left corner is at (2,2) & upper right corner is at (3,4) onto (a) A viewport that is the entire normalized device screen and (b) A viewport that has lowerleft corner at (0,0) and upper left corner (3/2,3/2).