Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;

Slides:



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

COMPUTER GRAPHICS SOFTWARE.
Chapter 2: Graphics Programming
Graphics Pipeline.
In the name of God Computer Graphics Bastanfard.
Lecture 4: 3D Rendering Pipeline (I) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
1 Lecture 2 Main components of graphical systems Graphical devices.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
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)
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
ISC/GAM 4322 ISC 6310 Multimedia Development and Programming Unit 1 Graphics Systems and Models.
1 Computer Graphics Week3 –Graphics & Image Processing.
Computer Graphics Computer Graphics is everywhere: Visual system is most important sense: High bandwidth Natural communication Fast developments in Hardware.
Interactive Input Methods & Graphical User Input
Chapter 1: Graphics Systems and Models Instructor: Shih-Shinh Huang 1.
CGMB214: Introduction to Computer Graphics
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.
OpenGl Graphics Programming. Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin.
1 Input and Interaction. 2 Input Devices Physical input devices Keyboard devices and pointing devices Logical input devices.
COMPUTER GRAPHICS Hochiminh city University of Technology Faculty of Computer Science and Engineering CHAPTER 01: Graphics System.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Institute for Visualization and Perception Research 1 © Copyright 2000 Haim Levkowitz Introduction (Foley & Van Dam Ch 1) Uses of computer graphics … Some.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
1 Graphics CSCI 343, Fall 2015 Lecture 4 More on WebGL.
CSE Real Time Rendering Week 2. Graphics Processing 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Computer Graphics Week2 –Creating a Picture. Steps for creating a picture Creating a model Perform necessary transformation Lighting and rendering the.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
1 Graphics CSCI 343, Fall 2015 Lecture 2 Introduction to HTML, JavaScript and WebGL.
Computer Graphics Lecture 32 Fasih ur Rehman. 3D Transforms The idea of 3D transforms is the same as that of 2D – A 3D point is represented by (x, y,
HARDWARE INPUT DEVICES GETTING DATA INTO THE COMPUTER.
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 OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Chapter 2 Computer Graphics and Visualization.   Programming oriented approach is used.  Minimal application programmer's interface (API) is used which.
Program 2 due 02/01  Be sure to document your program  program level doc  your name  what the program does  each function  describe the arguments.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
1 Graphics CSCI 343, Fall 2015 Lecture 3 Introduction to WebGL.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
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.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
Computer Graphics Lecture 17 Fasih ur Rehman. Last Class 3D Transforms Inverse Rotation.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Graphics Graphics Korea University kucg.korea.ac.kr Graphics Programming 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
- Introduction - Graphics Pipeline
The Graphics Rendering Pipeline
Real-time Computer Graphics Overview
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Interactive Input Methods & Graphical User Input
Models and Architectures
Interactive Input Methods & Graphical User Input
Models and Architectures
Presentation transcript:

Graphics Programming

Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program; measurements from input devices, such as the mouse and keyboard; and possibly other input, such as messages from the operating system. The outputs are primarily the graphics sent to our output devices.

Graphics System as a Black Box

API functions A graphics system performs multiple tasks to produce output and handle user input. An API for interfacing with this system can contain hundreds of individual functions. It will be helpful to divide these functions into seven major groups: 1. Primitive functions 2. Attribute functions 3. Viewing functions 4. Transformation functions 5. Input functions 6. Control functions 7. Query functions

Primitive functions define the low-level objects or atomic entities that our system can display. Depending on the API, the primitives can include points, line segments, polygons, pixels, text, and various types of curves and surfaces. OpenGL supports a very limited set of primitives directly, only points, line segments, and triangles.

Primitive functions con… For the most important objects such as Regular polyhedra, quadrics, and Bezier curves and surfaces that are not directly supported by OpenGL, there are libraries that provide the necessary code.

Attribute functions If primitives are the what of an API then attributes are the how. The attributes govern the way that a primitive appears on the display. Attribute functions allow us to perform operations ranging from choosing the color with which we display a line segment, to picking a pattern with which to fill the inside of a polygon, to selecting a typeface for the titles on a graph.

Viewing functions allow us to specify various views, although APIs differ in the degree of flexibility they provide in choosing a view. OpenGL does not provide any viewing functions but relies on the use of transformations in the shaders to provide the desired view.

Transformation functions One of the characteristics of a good API is that it provides the user with a set of transformation functions that allows her to carry out transformations of objects, such as rotation, translation, and scaling.

Input functions For interactive applications, an API must provide a set of input functions to allow us to deal with the diverse forms of input that characterize modern graphics systems. We need functions to deal with devices such as keyboards, mice, and data tablets

Control functions In any real application, we also have to worry about handling the complexities of working in a multiprocessing, multi window environment usually an environment where we are connected to a network and there are other users. The control functions enable us to communicate with the window system, to initialize our programs, and to deal with any errors that take place during the execution of our programs.

Query functions. within our applications we can often use other information within the API, including camera parameters or values in the frame buffer. A good API provides this information through a set of query functions.

Primitives and attributes We can separate primitives into two classes: geometric primitives and image, or raster, primitives. Geometric primitives are specified in the problem domain and include points, line segments, polygons, curves, and surfaces.

Primitives and attributes These primitives pass through a geometric pipeline, as shown in Figure where they are subject to a series of geometric operations that determine whether a primitive is visible, where on the display it appears if it is visible, and the rasterization of the primitive into pixels in the frame buffer.

Opengl Pipeline

Primitives and attributes The basic OpenGL geometric primitives are specified by sets of vertices. When we want to display some geometry, we execute functions whose parameters specify how the vertices are to be interpreted.

OpenGL geometric primitives All OpenGL geometric primitives are variants of points, line segments, and triangular polygons. A point can be displayed as a single pixel or a small group of pixels. Finite sections of lines between two vertices, called line segments.

Points and Line segment type If we wish to display points or line segments, we have a few choices in OpenGL The primitives and their type specifications include the following:

Polygon in Opengl The only OpenGL polygons that OpenGL supports are triangles. Triangle types

Polygon in Opengl Triangle strip and triangle fan