Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 1 1.

Slides:



Advertisements
Similar presentations
MEG 361 CAD Chapter 3 Basic Concepts of Graphics Programming.
Advertisements

มุมมองใน 2 มิติ (2-D Viewing)
Graphics Pipeline.
In the name of God Computer Graphics Bastanfard.
Computer Graphics Viewing.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
2 D viewing Prepared by Elizabeth Isaac DCS, RSET.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
Lecture 7 2D viewing 1 Lecture 7. 2D Viewing 2D viewing pipeline Clipping window, Normalization viewport transformation OpenGL 2D viewing functions Setup.
CHAPTER 7 2D VIEWING CGMB214: Introduction to Computer Graphics.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter 3 Additional Drawing Tools Ureerat Suksawatchon Department of Computer.
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
Output Primitives Computer Graphics.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphics Two Dimensional Viewing Dr. Eng. Farag Elnagahy
Introduction to constructive graphics Basic ideas - Coordinate systems - Graphics viewing pipeline.
IE433 CAD/CAM Computer Aided Design and Computer Aided Manufacturing Part-4 Computer Graphics- CAD Software Dr. Abdulrahman M. Al-Ahmari Industrial Engineering.
3.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 3 Viewing Transformation Getting Started with OpenGL Introduction to Projections.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
2D Viewing. 2D viewing transformation is a mapping of world coordinate scene to device coordinates xw min xw max yw min yw max xv min xv max yv min yv.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
1 CMT Fundamentals of Computer Graphics Revision Dr. Xiaohong Gao BG---Room 2C23 Week 11.
Two-Dimensional Viewing
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Two Dimensional Viewing
3D Viewing.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
Geometric Transformations
Camera. Content Coordinate systems and transformations Viewing coordinates Coordinate transformation matrix Projections Window and viewport Acknowledgments:
2 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Fall Computer Engineering METU.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
1 Computer Graphics Week9 -3D Geometric Transformation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
CS552: Computer Graphics Lecture 6: Viewing in 2D.
A.Aruna/Assistant Professor/SNSCE
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter 3 Additional Drawing Tools PART I.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Chapter: Viewing.
Write Bresenham’s algorithm for generation of line also indicate which raster locations would be chosen by Bresenham’s algorithm when scan converting.
Chun-Yuan Lin Coordinate Reference Frames 2016/6/22 1 CG.
3 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Two-Dimensional Viewing Hearn & Baker Chapter 6
Computer Graphic 2 D Viewing.
Viewing Viewing and viewing space (camera space)
Computer Graphics CC416 Week 14 3D Graphics.
In the name of God Computer Graphics.
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
Two-Dimensional Viewing
2D Viewing & Clipping 한신대 류승택
2D Viewing Pipeline.
3D Transformation Pipeline
WINDOWING AND CLIPPING
Three Dimensional Viewing
o عَلَّمَهُ الْبَيَانَ
WINDOWING AND CLIPPING
3D Graphics.
3D Viewing.
THREE-DIMENSIONAL VIEWING
Presentation transcript:

Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 1 1

2 Two-Dimensional Viewing Co-ordinate Systems.  Cartesian – offsets along the x and y axis from (0.0)  Polar – rotation around the angle .  Graphic libraries mostly using Cartesian co-ordinates  Any polar co-ordinates must be converted to Cartesian co- ordinates  Four Cartesian co-ordinates systems in computer Graphics. 1. Modeling co-ordinates  2. World co-ordinates  3. Normalized device co-ordinates  4. Device co-ordinates

3 Modeling Coordinates  Also known as local coordinate.  Ex: where individual object in a scene within separate coordinate reference frames.  Each object has an origin (0,0)  So the part of the objects are placed with reference to the object’s origin.  In term of scale it is user defined, so, coordinate values can be any size.

4 World Co-ordinates.  The world coordinate system describes the relative positions and orientations of every generated objects.  The scene has an origin (0,0).  The object in the scene are placed with reference to the scenes origin.  World co-ordinate scale may be the same as the modeling co- ordinate scale or it may be different.  However, the coordinates values can be any size (similar to MC)

5 Normalized Device Co-ordinates  Output devices have their own co-ordinates.  Co-ordinates values:  The x and y axis range from 0 to 1  All the x and y co-ordinates are floating point numbers in the range of 0 to 1  This makes the system independent of the various devices coordinates.  This is handled internally by graphic system without user awareness.

6 Device Co-ordinates  Specific co-ordinates used by a device.  Pixels on a monitor  Points on a laser printer.  mm on a plotter.  The transformation based on the individual device is handled by computer system without user concern.

7 Two-Dimensional Viewing Example:  Graphic program which draw an entire building by an architect but we only interested on the ground floor  Map of sales for entire region but we only like to know from certain region of the country.

8 Two-Dimensional Viewing  When we interested to display certain portion of the drawing, enlarge the portion, windowing technique is used  Technique for not showing the part of the drawing which one is not interested is called clipping  An area on the device (ex. Screen) onto which the window will be mapped is called viewport.  Window defines what to be displayed.  A viewport defines where it is to be displayed.  Most of the time, windows and viewports are usually rectangles in standard position(i.e aligned with the x and y axes). In some application, others such as general polygon shape and circles are also available  However, other than rectangle will take longer time to process.

9 Viewing Transformation  Viewing transformation is the mapping of a part of a world- coordinate scene to device coordinates.  In 2D (two dimensional) viewing transformation is simply referred as the window-to-viewport transformation or the windowing transformation.  Mapping a window onto a viewport involves converting from one coordinate system to another.  If the window and viewport are in standard position, this just  involves translation and scaling.  if the window and/or viewport are not in standard, then extra transformation which is rotation is required.

10 Viewing Transformation x-world y-world window Normalised device world y-view x-view

11 Window-To-Viewport Coordinate Transformation Window-to-Viewport transformation

12 Window-To-Viewport Coordinate Transformation. XWmax YWmax XWmin YWmin XVmaxXVmin YVmax YVmin xw,yw xv,yv

13 Window-To-Viewport Coordinate Transformation xv - xv min= xw - xw min xv - xv min= xw - xw min xv max - xv min xw max - xw min xv max - xv min xw max - xw min yv – yv min = yw - yw min yv max – yv min yw max - yw min From these two equations we derived xv = xv min + (xw – xw min )sx yv = yv min + (yw – yw min )sy where the scaling factors are sx = xv max – xv min sy = yv max - yv min sx = xv max – xv min sy = yv max - yv min xw max – xw min yw max - yw min xw max – xw min yw max - yw min

14 Window-To-Viewport Coordinate Transformation The sequence of transformations are: 1. Perform a scaling transformation using a fixed-point position of (xw min, yw min ) that scales the window area to the size of the viewport. 2. Translate the scaled window area to the position of the viewport.

15 Window-To-Viewport Coordinate Transformation  Relative proportions of objects are maintained if the scaling factors are the same (sx = sy). Otherwise, world objects will be stretched or contracted in either x or y direction when displayed on output device. about character strings when map to viewport?  How about character strings when map to viewport?  maintains a constant character size (apply when standard character fonts cannot be changed).  If character size can be changed, then windowed will be applied like other primitives.  For characters formed with line segments, the mapping to viewport is carried through sequence of line transformations.  For characters formed with line segments, the mapping to viewport is carried through sequence of line transformations.

16 Viewport-to-Normalized Device Coordinate Transformation  From normalized coordinates, object descriptions can be mapped to the various display devices  When mapping window-to-viewport transformation is done to different devices from one normalized space, it is called workstation transformation.

17 The Viewing Pipeline

18 OpenGL 2D Viewing Functions To transform from world coordinate to screen coordinates, the appropriate matrix mode must be chosen glMatrixMode (GL_PROJECTION); glLoadIdentity( ); To define a 2D clipping window, we use OpenGL Utility function: gluOrtho2D( xwmin, xwmax, ywmin, ywmax); This function also perform normalization (NDC)

19 OpenGL 2D Viewing Functions To specify the viewport parameters in OpenGL, we use function glViewport(xvmin, yvmin, vpWidth, vpHeight);