1 / 10

9. Viewing Transformations

ME 521 Computer Aided Design. 9. Viewing Transformations. Dr . Ahmet Zafer Şenalp e-mail: azsenalp@gyte.edu.tr Makine Mühendisliği Bölümü Gebze Yüksek Teknoloji Enstitüsü. Introduction. 9. Viewing Transformations.

benson
Download Presentation

9. Viewing Transformations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ME 521 ComputerAidedDesign 9. ViewingTransformations Dr. Ahmet Zafer Şenalpe-mail: azsenalp@gyte.edu.tr Makine Mühendisliği Bölümü Gebze Yüksek Teknoloji Enstitüsü

  2. Introduction 9. ViewingTransformations In engineering the picture coordinates are in inches, meters, etc. but the screen coordinates are e.g. 0-1023. The screen coordinates are difficult to work with since they are integers and also when zooming or panning the range is not enough. This can be avoided if the picture can be defined in world coordinates or page coordinates and through the viewing transformations these can be expressed in screen coordinates. 2-D viewing transformations would allow scaling, rotation and translation. The transformed picture would be clipped and visible portion would be added to the display file. The transformation generally without the rotation part is known as windowing transformation. GYTE-Makine Mühendisliği Bölümü

  3. Viewport 9. ViewingTransformations Viewport (ScreenWindow): A clipping algorithm permits the boundaries of the clipping region to be set anywhere on the screen. This is a very useful feature. It allows us to display the picture in a rectangle smaller than the screen, thus leaving blank areas in which to display messages, command menus and etc. A rectangular region such as this, is called a viewport. It is possible to clip several different pictures to different viewports and display them simultaneously on the screen. Viewport is associated with screen. GYTE-Makine Mühendisliği Bölümü

  4. Windows 9. ViewingTransformations WINDOWS: Process of preparing a transformed picture for display takes place in two steps: a) Transformation into screen coordinates b) Clipping to the viewport boundary This is wasteful in time if carried out in this order, since we may find that most of the lines lie outside of the screen. It is better to distinguish lines before transforming them. This is done by clipping to the window, which is the image of the viewport in the coordinates of the picture before transformation. Window is always another four-sided region; it is always the same shape as the viewport provided the picture is scaled by the same amount in x and y. If no rotation is applied, the window like the viewport has its edges parallel to the axes. GYTE-Makine Mühendisliği Bölümü

  5. Windows 9. ViewingTransformations When rotated information has to be clipped, we apply clipping using the viewport as the clipping region, or after transformation. Unrotated pictures on the other hand are clipped before transformation, using the window. • World or Page coordinates - original definition of space • Screen coordinates - final definition of space GYTE-Makine Mühendisliği Bölümü

  6. WindowingTransformations 9. ViewingTransformations Window and viewport are often more convenient to use than scale and translation in defining the transformation from page to screen. e.g. If a large picture is to be examined, viewport or window size is kept fixed, and the window position is moved, this allows us to scan the picture at a fixed magnification. Fixing the window center and varying its size changes the magnification. GYTE-Makine Mühendisliği Bölümü

  7. WindowingTransformations 9. ViewingTransformations Assume entire screen as viewport. Choose window with center at (Wcx , Wcy) in the page coordinate system. Size of window measured from the center is Wsx , Wsy. The equations defining the transformation of a point (Xp, Yp) in the page to a point (Xs , Ys) on the screen are: so Xs and Ys are unitless and are (-1) to (1). If viewport is less than the screen and has a center at (Vcx , Vcy) and the size is Vsx x Vsy , measuring the size from the center and expressing all in screen coordinates. GYTE-Makine Mühendisliği Bölümü

  8. WindowingTransformations 9. ViewingTransformations Then the point (Xp , Yp ) in page coordinates maps into the following point in screen coordinates: GYTE-Makine Mühendisliği Bölümü

  9. WindowingTransformations 9. ViewingTransformations Alternative Windowing Transformation: GYTE-Makine Mühendisliği Bölümü

  10. WindowingTransformations 9. ViewingTransformations For efficiency the above equations can be reduced to: a, b, c, d are precalculated and each point is then processed using these equations. GYTE-Makine Mühendisliği Bölümü

More Related