Two dimensional viewing
Upcoming SlideShare
Loading in...5
×
 

Two dimensional viewing

on

  • 1,561 views

 

Statistics

Views

Total Views
1,561
Views on SlideShare
1,561
Embed Views
0

Actions

Likes
0
Downloads
50
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Two dimensional viewing Two dimensional viewing Presentation Transcript

  • It is a formal mechanism for displaying viewsof a picture on an output device. A graphicspackage allows the user to specifya) 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 asmall 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 systemcalled a viewing coordinate system isintroduced to show the effect of moving view.
  • Window World Coordinate SystemAn image representing a view often becomespart of a larger image, like a photo on analbum page. Since album pages vary &monitor size differs from one system toanother, 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 areais (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 SystemThe process to convert object coordinate inWCS to NDCS is called window to viewportmapping or normalized transformation.
  • The process that maps NDCS to discretedevice/image coordinate is calledworkstation transformation. Workstation Viewport Device/Image co-ordinate System
  • Which is a 2nd window to viewport mappingwith a workstation window in NDCS &workstation viewport in device coordinatesystem. These two coordinate mappingOpn. refers to as viewing transformation.
  • Window to Viewport TransformationOnce 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 coordinateThis 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 yvmaxywmin 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 – vyminSolving 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 – wyminSince the eight coordinate values that definethe window & the viewport are just constant,we can express these two formulas forcomputing (vx,vy) from (wx,wy) in terms oftranslate-scale-translate transformation N.
  • vx wx vy = N . wy 1 1Where 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 1Put 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 = 1Sx = vxmax – vxmin = 1 – 0 =1 wxmax – wxmin 3 - 1 2Sy = vymax – vymin = 1 - 0 = 1 wymax – wymin 5 - 1 4N= 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/2Sx = ½ - 0 = ½ = ¼ 3- 1 2
  • Sy = ½ -0 = ½ = 1/8 5 -1 4N = 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).