2003CS Hons RW778 Graphics1 Chapter 1: Introduction Admin: Admin: –Lecture slots: Monday 8-9:45, Tuesday 9:15-11:00. –Book: F. Hill, Computer Graphics.

Slides:



Advertisements
Similar presentations
Computer Graphics - Graphics Programming -
Advertisements

Chapter 2: Graphics Programming
Computer Graphics CSCE 441
Pemrograman OpenGL Dasar
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
1 Computer Graphics chapter 1 Dr. Jehad Q. O. Alnihoud Phone: 3354.
OpenGL (Graphics Library) Software Interface to graphics software Allows to create interactive programs that produce color images of moving 3D objects.
OpenGL (I). What is OpenGL (OGL)? OGL is a 3D graphics & modeling library Can also use it to draw 2D objects.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Computer Science,
Device Independent Graphics and OpenGL
ITEPC 06 - Workshop on Fractal Creation Chiew-Lan Tai and Oscar Au.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphicsIntroduction Dr. Eng. Farag Elnagahy
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
Computer Graphics Hardware and Software Lecture Notes, CEng 477.
1.Introduction to Computer Graphics GMR lab. What is computer garphics? The generation of graphical output using a computer Refers to creation, Storage.
Reference1. [OpenGL course slides by Rasmus Stenholt]
CS380 LAB I OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Lecture 1 Introduction to Computer Graphics. Course Outline Graphics systems and applications. Graphics primitives. Coordinate system and frames. Line.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Lecture 2.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Graphics Programming and OpenGL.
Computer Graphics Bing-Yu Chen National Taiwan University.
Basic OpenGL Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, September 10, 2003.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
Computer Graphics Raster Devices Transformations Areg Sarkissian.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter 2 Initial Steps in Drawing Figures Ureerat Suksawatchon Faculty of Informatics.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
1 Figures are extracted from Angel's book (ISBN x) The Human Visual System vs The Pinhole camera Human Visual System Visible Spectrum Pinhole.
CD2012 Principles of Interactive Graphics Lecture 01 Introduction Abir Hussain (Rome: 6.33,Tel , Web:
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Introduction to Computer Graphics 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Programming with OpenGL Review.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic Light Source.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
NoufNaief.net TA: Nouf Al-harbi.
1 Chapter 1: Graphics Systems and Models. 2 Applications of C. G. – 1/4 Display of information Maps GIS (geographic information system) CT (computer tomography)
What are Computer Graphics Basically anything that is on you Monitor – This includes the text that you will see Text isn’t Advanced Graphics But…. Understanding.
CSCE 441: Computer Graphics
OpenGL Basic Drawing 2003 Spring Keng Shih-Ling
CS552: Computer Graphics Lecture 6: Viewing in 2D.
1 Programming with OpenGL Part 2: Complete Programs.
OpenGL API 2D Graphic Primitives Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
31/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 2: Introduction.
OpenGL Basic Drawing Jian-Liang Lin A Smidgen of OpenGL Code #include main() { InitializeAWindowPlease(); glClearColor (0.0, 0.0, 0.0, 0.0); glClear.
Introduction to OpenGL Muhammad Aamir Khan Lecturer, DCS, UOP.
Introduction to Graphics Programming. Graphics API.
Graphics Graphics Korea University kucg.korea.ac.kr Graphics Programming 고려대학교 컴퓨터 그래픽스 연구실.
Introduction to Graphics Programming. Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera.
Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL: Event-driven How in OpenGL? Programmer registers callback functions Callback function called when.
INTRODUCTION TO OPENGL
COMP413: Computer Graphics Overview of Graphics Systems Chapter 1.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Elements of Pictures Output primitives:
The Human Visual System vs The Pinhole camera
Programming with OpenGL Part 2: Complete Programs
OpenGL API 2D Graphic Primitives
Programming with OpenGL Part 2: Complete Programs
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
גרפיקה ממוחשבת: מבוא ל-OpenGL
Coordinate Systems and Transforming the Coordinates
Drawing in the plane 455.
Introduction to OpenGL
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 2: Complete Programs
Presentation transcript:

2003CS Hons RW778 Graphics1 Chapter 1: Introduction Admin: Admin: –Lecture slots: Monday 8-9:45, Tuesday 9:15-11:00. –Book: F. Hill, Computer Graphics Using OpenGL (Little Big Bookstore) –Evaluation: 3hr closed book, 8 th week (50%) + weekly pracs (50%) –Pracs: Windows or Linux, OpenGL. CAREFUL when using 3D Studio Max. –This is a fun course, but also a LOT of hard work.

2003CS Hons RW778 Graphics2 Chapter 1 : Introduction Week 1: Introduction and OpenGL (Hill, Ch. 1,2). Week 1: Introduction and OpenGL (Hill, Ch. 1,2). Week 2: Windows and viewports; vector tools (Hill, Ch. 3,4). Week 2: Windows and viewports; vector tools (Hill, Ch. 3,4). Week 3: Vector tools (continued) (Hill, Ch. 4). Week 3: Vector tools (continued) (Hill, Ch. 4). Week 4: Transformations on objects (Hill, Ch. 5). Week 4: Transformations on objects (Hill, Ch. 5). Week 5: Polygonal meshes (Hill, Ch. 6). Week 5: Polygonal meshes (Hill, Ch. 6). Week 6: 3D viewing (Hill, Ch. 7). Week 6: 3D viewing (Hill, Ch. 7). Week 7: Lighting and face realism (Hill, Ch. 8). Week 7: Lighting and face realism (Hill, Ch. 8). Week 8: Exam Wednesday 09:00 Week 8: Exam Wednesday 09:00

2003CS Hons RW778 Graphics3 Chapter 1: Introduction 1.1 What is computer graphics (CG)? 1.1 What is computer graphics (CG)? –Simply pictures –Tools –Field of study 1.2 Where is CG used? 1.2 Where is CG used? –Art, entertainment, publishing –Image processing –Process monitoring, simulations, CAD –Scientific visualization

2003CS Hons RW778 Graphics4 Chapter 1: Introduction 1.3 Elements of pictures created in CG 1.3 Elements of pictures created in CG –Output primitives and attributes: »Polylines »Text »Filled regions »Raster images –1.3.1 Polylines »Connected sequence of straight lines

2003CS Hons RW778 Graphics5 Chapter 1: Introduction »Edge, vertex, polygon, simple polygon »Attributes: color, thickness, dashing, endpoint blending

2003CS Hons RW778 Graphics6 Chapter 1: Introduction –1.3.2 Text »Font, color, size, spacing, orientation »Tilting (graphs) –1.3.3 Filled regions » Filled shape – boundary (polygon) » Filling used for shadow effects

2003CS Hons RW778 Graphics7 Chapter 1: Introduction –1.3.4 Raster image »Consists of cells (called pixels) with color value »Stored as array of numerical values »Bitmap : 0-1 »Created as hand-designed, or computed, or scanned. »Computed: straight lines – “jaggies” »Easy manipulation (filters, cleanup)

2003CS Hons RW778 Graphics8 Chapter 1: Introduction –1.3.5 Shades of gray and color in raster images »Pixel depth : n bits => 2 n values (at least 256) »Smaller pixel depth => loss in quality. Banding. »Color: RGB »Color depth => sum of bits for each color »High quality (true color) : 24 bits (eye perception) 1.4 Graphics Display Devices 1.4 Graphics Display Devices –1.4.1 Line drawing (plotters): cross-hatching

2003CS Hons RW778 Graphics9 Chapter 1: Introduction –1.4.2 Raster displays (video monitor, flat-panel displays, printers) »Display surface (X,Y) »Frame buffer : memory to hold display pixels, with scan controller.

2003CS Hons RW778 Graphics10 Chapter 1: Introduction »Some hardware (video monitor) requires “refresh” : entire frame buffer scanned out to display many times per second.

2003CS Hons RW778 Graphics11 Chapter 1: Introduction »Video monitors : CRT CRT Digital-to-analog converters (DACs) Digital-to-analog converters (DACs) Refresh 60x per second to prevent flicker. Refresh 60x per second to prevent flicker. Scanning per line Scanning per line

2003CS Hons RW778 Graphics12 Chapter 1: Introduction –1.4.3 Indexed Color and the LUT »Programmable association between pixel value and color »Bits in frame buffer acts as index into LUT. »Palette: set of possible colors AT ONE TIME. –1.4.4 Other raster display devices: flat-panel, LCD, active matrix panels, plasma panel –1.4.5 Hard-copy raster devices: film recorder, laser printer, inkjet plotter. PostScript. 1.5 Graphics input primitives and devices 1.5 Graphics input primitives and devices –Selfstudy.

2003CS Hons RW778 Graphics13 Chapter 2: Drawing in OpenGL 2.1 Getting started 2.1 Getting started –Environment: window, coordinate system, elementary drawing routines –2.1.1 Device-independence and OpenGL »Libraries –2.1.2 Windows-based Programming »Event-driven, event queue and callbacks »System-dependent (glut) »Example: Fig. 2.2

2003CS Hons RW778 Graphics14 Chapter 2: Drawing in OpenGL #include #include // >>>>>>>>>>>>>>>>>>>>> void main(int argc, char** argv) { // initialize // create screen window glutDisplayFunc (myDisplay); glutMouseFunc (myMouse); glutKeyboardFunc (myKeyboard); glutMainLoop(); // go into a perpetual loop }

2003CS Hons RW778 Graphics15 Chapter 2: Drawing in OpenGL –2.1.3 Opening a window for drawing (framework) #include #include // >>>>>>>>>>>>>>>>>>>>> void main(int argc, char** argv) { glutInit(&argc, argv); // initialize the toolkit glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); // set display mode glutInitWindowSize(640,480); // set window size glutInitWindowPosition(100, 150); // set window position on screen glutCreateWindow("my first attempt"); // open the screen window glutDisplayFunc(myDisplay); // register redraw function myInit(); glutMainLoop(); // go into a perpetual loop }

2003CS Hons RW778 Graphics16 Chapter 2: Drawing in OpenGL 2.2 Drawing basic graphics primitives 2.2 Drawing basic graphics primitives –Establish coordinate system –Line drawing primitives : glBegin, glEnd, vertices –Example: glBegin (GL_POINTS); glVertex2i(100,50);glVertex2i(100,130);glVertex2i(150,130);glEnd(); -OpenGL commands: glVertex2i (…)

2003CS Hons RW778 Graphics17 Chapter 2: Drawing in OpenGL –OpenGL data types : GLint, GLfloat –OpenGL state: current state variables. »glColor3f (red, green, blue) »glClear (GL_COLOR_BUFFER_BIT) –Establish coordinate system »Matrices and transformations (ch. 3) –Fig. 2.10: A complete OpenGL program »Note glFlush();

2003CS Hons RW778 Graphics18 Chapter 2: Drawing in OpenGL –2.2.1 Drawing dot constellations »The Big Dipper »The Sierpinski Gasket »Simple dot plots (note scaling and shifting, which are affine transformations) 2.3 Line Drawings 2.3 Line Drawings glBegin (GL_LINES); glVertex2i(40, 100); glVertex2i(202, 96); glEnd();

2003CS Hons RW778 Graphics19 Chapter 2: Drawing in OpenGL –More than 2 vertices : paired –2.3.1 Drawing polylines and polygons »Polyline: collection of joined line segments, specified by ordered list of points. »OpenGL: GL_LINE_STRIP (open line segment) »GL_LINE_LOOP (closed line segment – not fillable area – GL_POLYGON) »Examples: line graphs, polylines from file, parameterizing figures, polyline drawer

2003CS Hons RW778 Graphics20 Chapter 2: Drawing in OpenGL –2.3.2 Line drawing with moveto() and lineto() »Current position –2.3.3 Drawing aligned rectangles »glRecti(x1,y1,x2,y2) –2.3.4 Aspect ratio of aligned rectangle »width/height »NB! Work through all practice exercises on pp. 60— 61.

2003CS Hons RW778 Graphics21 Chapter 2: Drawing in OpenGL –2.3.5 Filling polygons »Must be convex! –2.3.6 Other graphics primitives: »GL_TRIANGLES,GL_QUADS,GL_TRIANGLE_STRIP »GL_TRIANGLE_FAN,GL_QUAD_STRIP

2003CS Hons RW778 Graphics22 Chapter 2: Drawing in OpenGL 2.4 Simple mouse and keyboard interaction 2.4 Simple mouse and keyboard interaction –glut callbacks on events: glutMouseFunc, glutMotionFunc, glutKeyboardFunc –2.4.1 Mouse interaction : selfstudy –2.4.2 Keyboard interaction : selfstudy 2.6 Case studies: SELFSTUDY 2.6 Case studies: SELFSTUDY

2003CS Hons RW778 Graphics23 Chapter 2: Drawing in OpenGL Programming Task 1 : Implement Case Study 2.5 (Polyline Stippling), p. 75, in Hill. Programming Task 1 : Implement Case Study 2.5 (Polyline Stippling), p. 75, in Hill. Familiarize yourself with OpenGL, Linux (or Windows) and C/C++. Familiarize yourself with OpenGL, Linux (or Windows) and C/C++. The usual rules for programming projects hold: The usual rules for programming projects hold: –No extensions (demo Monday 08:00) –No copying/cheating –Accompanying report to be handed in at demo