1 Computer Graphics Dr. Amy Zhang Assistant Professor of Computer Science United International College.

Slides:



Advertisements
Similar presentations
Programming with OpenGL - Getting started - Hanyang University Han Jae-Hyek.
Advertisements

Computer Graphics - Graphics Programming -
Department of nskinfo i-education
Chapter 2: Graphics Programming
Computer Graphics CSCE 441
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
3D Graphics Rendering and Terrain Modeling
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
OpenGL (Graphics Library) Software Interface to graphics software Allows to create interactive programs that produce color images of moving 3D objects.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Computer Science,
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
Further Programming for 3D applications CE Introduction to Further Programming for 3D application Bob Hobbs Faculty of Computing, Engineering and.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner OpenGL, GLUT, Transformations.
CENG477 Introduction to Computer Graphics Introduction to OpenGL, GLUT and GLUI.
Interactive 3D Graphics and Virtual Reality Introduction to OpenGL concepts Session 2.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphicsIntroduction Dr. Eng. Farag Elnagahy
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
Today … The rendering pipeline in detail What is OpenGL
Introduction to OpenGL M. Ramanathan STTP CAD 2011Introduction to OpenGL.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
Introduction to OpenGL Jian Huang This set of slides are extracted from the Interactive OpenGL Programming course given by Dave Shreine, Ed Angel and Vicki.
Computer Graphics Bing-Yu Chen National Taiwan University.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
COMP4070 Computer Graphics Dr. Amy Zhang. Welcome! 2  Introductions  Administrative Matters  Course Outline  What is Computer Graphics?
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 GLUT Callback functions Event-driven: Programs that use windows  Input/Output  Wait until an event happens and then execute some pre-defined functions.
Computer Graphics Computer Graphics is everywhere: Visual system is most important sense: High bandwidth Natural communication Fast developments in Hardware.
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
1 Computer Graphics Introduction. 2 What is computer graphics Computer graphics is concerned with producing images and animations (or sequences of images)
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
Using OpenGL in Visual C++ Opengl32.dll and glu32.dll should be in the system folder Opengl32.dll and glu32.dll should be in the system folder Opengl32.lib.
CSC 461: Lecture 41 CSC461: Lecture 4 Introduction to OpenGL Objectives: Development of the OpenGL API OpenGL Architecture -- OpenGL as a state machine.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
UNIT I 2D PRIMITIVES INTRODUCTION 1 SNSCE/IT/ARUNA.
OpenGl Graphics Programming. Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric.
2 COEN Computer Graphics I Introductions n Brad Grantham lecturer lab dude n Dave Shreiner lecturer slave driver.
Programming with OpenGL Part 1: Background
Lecture 3 OpenGL.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Computer Graphics Researched via: Student Name: Cheyenne Bell Date: 04/29/2010.
1. OpenGL/GLU/GLUT  OpenGL v4.0 (latest) is the “core” library that is platform independent  GLUT v3.7 is an auxiliary library that handles window creation,
1 Figures are extracted from Angel's book (ISBN x) The Human Visual System vs The Pinhole camera Human Visual System Visible Spectrum Pinhole.
1 Computer Graphics Week2 –Creating a Picture. Steps for creating a picture Creating a model Perform necessary transformation Lighting and rendering the.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Computer Graphics & Image Processing Lecture 1 Introduction.
Interactive Computer Graphics CS 418 MP1: Dancing I TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz Slides Taken from: “An Interactive Introduction to OpenGL.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 4 of 41 William H. Hsu Department of Computing.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Computer Graphics Bing-Yu Chen National Taiwan University.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
NoufNaief.net TA: Nouf Al-harbi.
CISC 110 Day 3 Introduction to Computer Graphics.
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
CSCE 441: Computer Graphics
CS552: Computer Graphics Lecture 6: Viewing in 2D.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
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 Graphics Programming. Graphics API.
Introduction to Graphics Programming. Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera.
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
The Human Visual System vs The Pinhole camera
Programming with OpenGL Part 2: Complete Programs
גרפיקה ממוחשבת: מבוא ל-OpenGL
AN INTRODUCTION TO COMPUTER GRAPHICS Subject: Computer Graphics Lecture No: 01 Batch: 16BS(Information Technology)
Computer Graphics Practical Lesson 1-
Multimedia (CoSc4151) Chapter One : Introduction to Multimedia
Presentation transcript:

1 Computer Graphics Dr. Amy Zhang Assistant Professor of Computer Science United International College

2 Welcome!  Applications  Introductions  What is computer graphics?  OpenGL and GLUT Overview

3 Applications  Movies and games  Visualization techniques for creating images, diagrams, or animations to communicate a message.  Digital photography  Computer aided design (CAD) the use of computer technology for the design of objects, real or virtual.

4  Virtual reality a technology which allows a user to interact with a computer- simulated environment, whether that environment is a simulation of the real world or an imaginary world.  Augmented reality a live direct or indirect view of a physical real-world environment whose elements are merged with (or augmented by) virtual computer-generated imagery - creating a mixed reality.  Art

5 Movies & Games

6 Visualization

7 Digital Photography

8 Computer Aided Design (CAD)

9 Virtual and Augmented Reality v.zol.com.cn/video62155.html

10 Art “Contact Water” Taisuke Murakami, 2001 Artificial Evolution for Computer Graphics Karl Sims, SIGGRAPH ’91 Steven Parente

11 What is Computer Graphics?  Computer graphics Computer graphics deals with all aspects of creating images with a computer  Graphics often combine text, illustration, and color, visual presentations on surfaces, e.g. a wall, canvas, computer screen, paper, or stone to brand, inform, illustrate, or entertain. Examples: photographs, drawings, line art, graphs, diagrams, typography, numbers, symbols, geometric designs, maps, engineering drawings, etc.

12 General concepts  Image an artifact, usually two-dimensional, that has a similar appearance to some subject—usually a physical object or a person. They may be captured by optical devices—such as cameras, mirrors, lenses, telescopes, microscopes, etc. and natural objects and phenomena, such as the human eye or water surfaces. A digital image is a representation of a two-dimensional image using ones and zeros (binary).  Pixel the smallest piece of information in an image. normally arranged in a regular 2-dimensional grid, and are often represented using dots or squares. The intensity of each pixel is variable; in color systems, each pixel has typically three components such as red, green, and blue.

13  Rendering the process of generating an image from a model, by means of computer programs, is also used to describe the process of calculating effects in a video editing file to produce final video output.model  Model a description of 3 dimensional objects in a strictly defined language or data structure. It would contain geometry, viewpoint, texture, lighting, and shading information. texturelightingshading

14  Animation the rapid display of a sequence of images of 2-D or 3-D artwork or model positions in order to create an illusion of movement.

15 The graphics process  Process to simulate interaction of light and matter

16 1.Modeling  Vertex  Polygon a plane figure that is bounded by a closed path or circuit, composed of a finite sequence of straight line segments Model Surface Vertex

17 Graphical Models  Geometric 2D and 3D objects Triangles, quadrilaterals, polygons Spheres, cones, boxes Surface characteristics Color Texture Composite objects Objects and their relationships to each other  Lighting, shading, animation, fog, etc.

18 The basic idea  Describe an object using surfaces, which are polygons Triangles, quadrilaterals, whatever Important thing is that they are flat They must also be convex  Provide points in counterclock-wise order From the visible side

19 2.Transformations  Scaling  Translation  Rotation  Skew (Shear)

20 3.Texturing  Texture - A bitmap image applied to a surface in computer graphics  Make 3D objects realistic without texturewith texture

21  Texture/Displacement/Bump Map

22 4.Viewing and projections  Central projection  Parallel projection

23 5.Light and Color

24 6. Illumination Models

25 7. Shading models

26 Rasterization  Conversion of 3D model to 2D image Projection Determine pixel Determine color

27 8.Ray Tracing  Back tracing the ray coming into the viewer’s eye

28 9. Curves & Surfaces  Free shape control/animation  Less storage

29 Animation

30 OpenGL and GLUT Overview

31 What Is OpenGL?  Graphics rendering API high-quality color images composed of geometric and image primitives window system independent operating system independent

32 OpenGL as a Renderer  Geometric primitives points, lines and polygons  Image Primitives images and bitmaps separate pipeline for images and geometry linked through texture mapping  Rendering depends on state colors, materials, light sources, etc.

33 Preliminaries  Headers Files #include glut.h automatically include the others  Libraries gult3d.lib, glut32.dll  Enumerated Types OpenGL defines numerous types for compatibility  GLfloat, GLint, GLenum, etc.

34 Compilation on Windows  Get glut.h, glut32.lib, glut32.dll from web  Create a console application  Store glut.h in Additional include directory  Add opengl32.lib, glut32.lib to project settings (under link tab) and store them in Additional library directory  Add glut32.dll to c:/windows/system32

35 GLUT Basics  Application Structure Configure and open window Initialize OpenGL state Register input callback functions render resize input: keyboard, mouse, etc. Enter event processing loop

36 Sample Program void main( int argc, char** argv ) { int mode = GLUT_RGB|GLUT_DOUBLE; glutInitDisplayMode( mode ); glutCreateWindow( argv[0] ); init(); glutDisplayFunc( display ); glutReshapeFunc( resize ); glutKeyboardFunc( key ); glutIdleFunc( idle ); glutMainLoop(); }

37 OpenGL Initialization  Set up whatever state you’re going to use void init( void ) { glClearColor( 0.0, 0.0, 0.0, 1.0 ); glClearDepth( 1.0 ); glEnable( GL_LIGHT0 ); glEnable( GL_LIGHTING ); glEnable( GL_DEPTH_TEST ); }

38 GLUT Callback Functions  Routine to call when something happens window resize or redraw user input animation  “Register” callbacks with GLUT glutDisplayFunc( display ); glutIdleFunc( idle ); glutKeyboardFunc( keyboard );

39 Rendering Callback  Do all of your drawing here glutDisplayFunc( display ); void display( void ) { glClear( GL_COLOR_BUFFER_BIT ); glBegin( GL_TRIANGLE_STRIP ); glVertex3fv( v[0] ); glVertex3fv( v[1] ); glVertex3fv( v[2] ); glVertex3fv( v[3] ); glEnd(); glutSwapBuffers(); }

40 Idle Callbacks  Use for animation and continuous update glutIdleFunc( idle ); void idle( void ) { t += dt; glutPostRedisplay(); }

41 User Input Callbacks  Process user input glutKeyboardFunc( keyboard ); void keyboard( char key, int x, int y ) { switch( key ) { case ‘ q ’ : case ‘ Q ’ : exit( EXIT_SUCCESS ); break; case ‘ r ’ : case ‘ R ’ : rotate = GL_TRUE; break; }

42 Summary  There is one field called the primary key which uniquely identify a record  SQL can be used to Create the tables Add, change, and delete data Query the DB for specific information  DB vs File System  ER model