OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL

Size: px
Start display at page:

Download "OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL"

Transcription

1 OpenGL (euske) 1 OpenGL OpenGL 1. Client-Server Model D OpenGL (Depth-Buffer Algorithm Z-Buffer Algorithm) (polygon ) ( rendering) Client-Server Model X Window System ( GL ) GL (Indy O 2 ) X (GLX) X GL X X GL X (drawable : ) OpenGL ( ) ( (texture mapping) (antialiasing) ) 1. GL 2. GL (primitive) ( ) ( ) 3. ( ) 4. 3D 2D (clip) ( ) (flat shading) (smooth shading) OpenGL (glow shading) OpenGL 3D 1

2 (diffuse) (specular) (ambient) 2 ( ) ( ) OpenGL 2D 3D 2.1 OpenGL 3 1. OpenGL gl prefix 2. OpenGL Utility (GLU) bitmap glu prefix 3. OpenGL X (GLX) X Window System glx prefix GL void gl < FUNCTION > {#}{s i f d}{v} (...); ( ) < F UNCT ION > #( ) s, i, f, d glvertex3f void glvertex3f (GLfloat x, GLfloat y, GLfloat z); v ( ) void glvertex3fv (GLfloat v[3]); GLfloat GL float < gl.h > s GLshort short (16bit) i GLint int (32bit) f GLfloat float(32bit) d GLdouble double(64bit) GLenum 2

3 2.2 (primitive ) (glbegin) (glvertex) void glbegin (GLenum mode 1 ); void glend (void); void glfrontface (GLenum mode 2 ); void glvertex3{s i f d} (GL?? x, GL?? y, GL?? z); void glvertex3{s i f d}v (GL?? v[3]); void glnormal3{s i f d} (GL?? x, GL?? y, GL?? z); void glnormal3{s i f d}v (GL?? v[3]); glvertex2 glvertex4 glnormal3* glvertex3* glvertex3* gltexcoord2* ( ) glvertex3* 1 1 glnormal3* glvertex3* glnormal3* 1. glbegin(type); GL POLYGON 4 (convex) 2. glnormal3*(..); ( ) 3. (a) gltexcoord2*(..); (b) glvertex3*(..); 4. glend(); glfrontface GL CW GL CCW ( ) 1 mode: GL POLYGON, GL QUADS, GL TRIANGLES.. 2 mode: GL CW, GL CCW 3

4 2.3 OpenGL 3D 2 void glmatrixmode (GLenum mode 3 ); void glloadidentify (void); void gltranslate{f d} (GL?? x, GL?? y, GL?? z); void glrotate{f d} (GL?? degree, GL?? x, GL?? y, GL?? z); void glscale{f d} (GL?? x, GL?? y, GL?? z); void glulookat (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz); void glfrustum (GLdouble left, GLdouble righgt, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far); void glviewport (GLint x, GLint y, GLsizei width, GLsizei height); void glpushmatrix (void); void glpopmatrix (void); glmatrixmode gltranslate*, glrotate*, glscale* glulookat ( ) glfrustum glviewport glpushmatrix, glpopmatrix 2.4 OpenGL 8 GL LIGHT0 GL LIGHT7 void gllight{i f} (GLenum light 4, GLenum pname, GL?? param..); void gllight{i f}v (GLenum light, GLenum pname, GL?? v[ ]); void glmaterial{i f} (GLenum face 5, GLenum pname, GL?? param..); void glmaterial{i f}v (GLenum face, GLenum pname, GL?? v[ ]); void glenable (GLenum light); gllight* ( ) 3 mode: GL MODELVIEW, GL PROJECTION, GL TEXTURE 4 light: GL LIGHT0, GL LIGHT1,..., GL LIGHT7 5 face: GL FRONT, GL BACK, GL FRONT AND BACK 4

5 (pname) GL AMBIENT 4 (R, G, B, A) GL DIFFUSE 4 (R, G, B, A) GL SPECULAR 4 (R, G, B, A) GL POSITION 4 (x, y, z, w) GL SPOT DIRECTION 3 (vx, vy, vz) GL SPOT CUTOFF 1 (degree) GL POSITION w w = 0 ( ) w RGBA A glenable 6 glmaterial* ( ) (pname) GL AMBIENT 4 (R, G, B, A) GL DIFFUSE 4 (R, G, B, A) GL AMBIENT AND DIFFUSE 4 (R, G, B, A) GL SPECULAR 4 (R, G, B, A) GL SHININESS 1 (shininess) GL EMISSION 4 (degree) ( hilite) ( ) 2.5 void glteximage2d (GL TEXTURE 2D, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GL RGB, GL UNSIGNED BYTE, const GLvoid* pixels); void gltexparameter{i f} (GL TEXTURE 2D, GLenum pname 7, GL?? param 8 ); void gltexcoord2{s i f d} (GL?? s, GL?? t); void gltexcoord2{s i f d}v (GL?? v[2]); OpenGL GLubyte teximagename[imagewidth][imageheight][3]; 6 glenable OpenGL 7 pname: GL TEXTURE WRAP S, GL TEXTURE WRAP T, GL TEXTURE MAG FILTER, GL TEXTURE MIN FILTER 8 param: GL CLAMP, GL REPEAT, GL NEAREST, GL LINER 5

6 glteximage2d GL RGB width, height 3 [x][y][0],[x][y][1], [x][y][2] Red, Green, Blue (0, 0)-(1, 1) (s, t) glvertex3* gltexcoord2* gltexparameter* GL TEXTURE MAG FILTER, GL TEXTURE MIN FILTER GL NEAREST GL LINER gltexparameter* GL TEXTURE WRAP S, GL TEXTURE WRAP T GL REPEAT gltexcoord2* 2.6 OpenGL (glbegin, glend, glvertex3*, gllight* ) 2 ( ) void glnewlist (GLuint list, GLenum mode 9 ); void glendlist (void); void glcalllist (GLuint list); 1. glnewlist ( ) 2. GL COMPILE GL COMPILE AND EXECUTE 3. glendlist 4. glcalllist glnewlist glendlist 2.7 void glclear (GLbitfield mask 10 ); void glclearcolor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void glcleardepth (GLclampd depth); void glshademodel (GLenum model 11 ); 9 mode: GL COMPILE, GL COMPILE AND EXECUTE 10 mask: GL COLOR BUFFER BIT, GL DEPTH BUFFER BIT 11 model: GL FLAT, GL SMOOTH 6

7 void glflush (void); void glenable (GLenum enable); void gldisable (GLenum enable); glclear glclearcolor, glcleardepth glshademodel glflush GL glenable, gldisable OpenGL / OpenGL : glenable(gl_lighting); glenable(gl_normalize); glenable(gl_texture_2d); glenable(gl_depth_test); // // // // Depth-Buffer gltexenv(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); // gllightmodelf(gl_light_model_two_side, GL_TRUE); // glshademodel(gl_flat); glclearcolor(0.0, 0.0, 0.0, 1.0); glcleardepth(0.0); glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT); // // // GLX OpenGL X XVisualInfo* glxchoosevisual (Display* dpy, int screen, int* attriblist); int glxgetconfig (Display* dpy, XVisualInfo* vis, int attrib, int* value); GLXContext glxcreatecomtext (Display* dpy, XVisualInfo* vis, GLXContext sharelist, Bool direct); Bool glxmakecurrent (Display* dpy, GLXDrawable draw, GLXContext ctx); GLXPixmap glxcreateglxpixmap (Display* dpy, XVisualInfo* vis, Pixmap pixmap); void glxswapbuffers (Display* dpy, Window window); GLX 1. glxchoosevisual Visual 2. glxcreatecontext X 5. Expose OpenGL 7

8 glxchoosevisual GL glxcreatecontext glxmakecurrent OK glxswapbuffers GLX DOUBLEBUFFER GLX : int list[] = {GLX_RGBA, // RGB GLX_RED_SIZE, 1, // Red, Green, Blue GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, // GLX_DOUBLEBUFFER, // None}; // XVisualInfo* myvisual; GLXContext mycontext; Display* dpy; Window win; Colormap colmap; mycontext = glxcreatecontext(dpy, myvisual, None, GL_FALSE); // X glxmakecurrent(dpy, win, mycontext); // dpy = XOpenDisplay(NULL); // X myvisual = glxchoosevisual(dpy, 0, list); // colmap = XCreateColormap(...); // win = XCreateSimpleWindow(...); // XSetWMProperties(...); // XMapWindow(...); // /* */... 8

Lecture 2 2D transformations Introduction to OpenGL

Lecture 2 2D transformations Introduction to OpenGL Lecture 2 2D transformations Introduction to OpenGL OpenGL where it fits what it contains how you work with it OpenGL parts: GL = Graphics Library (core lib) GLU = GL Utilities (always present) GLX, AGL,

More information

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University OpenGL Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University Background Software interface to graphics hardware 250+ commands Objects (models) are built from geometric primitives

More information

Lecture 07: Buffers and Textures

Lecture 07: Buffers and Textures Lecture 07: Buffers and Textures CSE 40166 Computer Graphics Peter Bui University of Notre Dame, IN, USA October 26, 2010 OpenGL Pipeline Today s Focus Pixel Buffers: read and write image data to and from

More information

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013 Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013 PROJECT GOAL: Write a restricted OpenGL library. The goal of the project is to compute all the transformation matrices with your

More information

VR-programming tools (procedural) More VRML later in this course! (declarative)

VR-programming tools (procedural) More VRML later in this course! (declarative) Realtime 3D Computer Graphics & Virtual Reality OpenGL Introduction VR-programming Input and display devices are the main hardware interface to users Immersion embeds users through the generation of live-like

More information

OpenGL An introduction

OpenGL An introduction OpenGL An introduction Camilla Berglund elmindreda@stacken.kth.se Introductory illustration by theodore This material is under a Creative Commons license http://creativecommons.org/licenses/by-sa/2.5/se/

More information

Lighting and Texturing

Lighting and Texturing Lighting and Texturing Michael Tao Michael Tao Lighting and Texturing 1 / 1 Fixed Function OpenGL Lighting Need to enable lighting Need to configure lights Need to configure triangle material properties

More information

Lecture 4 of 41. Lab 1a: OpenGL Basics

Lecture 4 of 41. Lab 1a: OpenGL Basics Lab 1a: OpenGL Basics William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/courses/cis636 Instructor

More information

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations #include int main(int argc, char** argv) { glutinit(&argc, argv); Typical OpenGL/GLUT Main Program // GLUT, GLU, and OpenGL defs // program arguments // initialize glut and gl // double buffering

More information

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40)

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40) 11(40) Information Coding / Computer Graphics, ISY, LiTH OpenGL where it fits what it contains how you work with it 11(40) OpenGL The cross-platform graphics library Open = Open specification Runs everywhere

More information

MB86290 Series 3D Graphics Library V02 User Manual The core API

MB86290 Series 3D Graphics Library V02 User Manual The core API MB86290 Series 3D Graphics Library V02 User Manual The core API Revision 1.0 Copyright FUJITSU LIMITED 1999-2003 ALL RIGHTS RESERVED 1. The specifications in this manual are subject to change without notice.

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 http://www.opengl.org Todays lecture What is OpenGL? How do I use it? Rendering pipeline Points, vertices, lines,, polygons Matrices and transformations Lighting and shading Code

More information

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실. Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing

More information

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps Image Rendering Rendering can be divided into three sub-problems Image Formation The hidden surface problem visibility determination steps Illumination Direct illumination Indirect illumination Shading

More information

Introduction to OpenGL

Introduction to OpenGL Introduction to OpenGL Tutorial 1: Create a window and draw a 2D square Introduction: The aim of the first tutorial is to introduce you to the magic world of graphics based on the OpenGL and GLUT APIs.

More information

A display list is a group of OpenGL commands that have been stored for later execution.

A display list is a group of OpenGL commands that have been stored for later execution. Introduction A display list is a group of OpenGL commands that have been stored for later execution. Most OpenGL commands can be either stored in a display list or issued in immediate mode. 1 For example,

More information

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010) Lecture 5: Viewing CSE 40166 Computer Graphics (Fall 2010) Review: from 3D world to 2D pixels 1. Transformations are represented by matrix multiplication. o Modeling o Viewing o Projection 2. Clipping

More information

Precept 2 Aleksey Boyko February 18, 2011

Precept 2 Aleksey Boyko February 18, 2011 Precept 2 Aleksey Boyko February 18, 2011 Getting started Initialization Drawing Transformations Cameras Animation Input Keyboard Mouse Joystick? Textures Lights Programmable pipeline elements (shaders)

More information

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 1 In this chapter, you will learn The basics of texture mapping Texture coordinates Texture objects and texture binding Texture specification

More information

Outline. Other Graphics Technology. OpenGL Background and History. Platform Specifics. The Drawing Process

Outline. Other Graphics Technology. OpenGL Background and History. Platform Specifics. The Drawing Process Outline 433-380 Graphics and Computation Introduction to OpenGL OpenGL Background and History Other Graphics Technology Drawing Viewing and Transformation Lighting GLUT Resources Some images in these slides

More information

Graphics and Computation Introduction to OpenGL

Graphics and Computation Introduction to OpenGL 433-380 Graphics and Computation Introduction to OpenGL Some images in these slides are taken from The OpenGL Programming Manual, which is copyright Addison Wesley and the OpenGL Architecture Review Board.

More information

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Computer Graphics. Chapter 10 Three-Dimensional Viewing Computer Graphics Chapter 10 Three-Dimensional Viewing Chapter 10 Three-Dimensional Viewing Part I. Overview of 3D Viewing Concept 3D Viewing Pipeline vs. OpenGL Pipeline 3D Viewing-Coordinate Parameters

More information

CS559: Computer Graphics. Lecture 12: OpenGL Li Zhang Spring 2008

CS559: Computer Graphics. Lecture 12: OpenGL Li Zhang Spring 2008 CS559: Computer Graphics Lecture 12: OpenGL Li Zhang Spring 2008 Reading Redbook Ch 1 & 2 So far: 3D Geometry Pipeline Model Space (Object Space) Rotation Translation Resizing World Space M Rotation Translation

More information

3D Graphics and API with OpenGL

3D Graphics and API with OpenGL 3D Graphics and API with OpenGL Human-Centered CAD Lab. 29-3-3 Contents 3D Graphics API & OpenGL Interactive Computer Graphics Example of OpenGL Programming Preparatory Simple code GLUT Functions Transformation

More information

cs123 Lab 3 OpenGL Part One 1 Introduction 2 OpenGL Basics 2.2 The Rendering Pipeline 2.1 The CPU and the GPU 2.3 Basic Syntax of OpenGL commands

cs123 Lab 3 OpenGL Part One 1 Introduction 2 OpenGL Basics 2.2 The Rendering Pipeline 2.1 The CPU and the GPU 2.3 Basic Syntax of OpenGL commands cs123 Lab 3 OpenGL Part One Introduction to Computer Graphics 1 Introduction From now on, our weekly labs will focus on the use of OpenGL. While the lectures and projects will let you get a deeper understanding

More information

Chapter 7 Display Lists

Chapter 7 Display Lists OpenGL Programming Guide (Addison-Wesley Publishing Company) Chapter 7 Display Lists Chapter Objectives After reading this chapter, you ll be able to do the following: Understand how display lists can

More information

Computer Graphics Programming

Computer Graphics Programming Computer Graphics Programming Graphics APIs Using MFC (Microsoft Foundation Class) in Visual C++ Programming in Visual C++ GLUT in Windows and Unix platform Overview and Application Graphics APIs Provide

More information

Introduction to OpenGL

Introduction to OpenGL CS100433 Introduction to OpenGL Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Before OpenGL Let s think what is need

More information

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou Introduction to OpenGL Transformations, Viewing and Lighting Ali Bigdelou Modeling From Points to Polygonal Objects Vertices (points) are positioned in the virtual 3D scene Connect points to form polygons

More information

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3 OpenGL Introduction Introduction OpenGL OpenGL is an API for computer graphics. Hardware-independent Windowing or getting input is not included in the API Low-level Only knows about triangles (kind of,

More information

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ EECS 104 Fundamentals of Computer Graphics OpenGL Slides courtesy of Dave Shreine, Ed Angel and Vicki Shreiner

More information

Basic Graphics Programming

Basic Graphics Programming 15-462 Computer Graphics I Lecture 2 Basic Graphics Programming Graphics Pipeline OpenGL API Primitives: Lines, Polygons Attributes: Color Example January 17, 2002 [Angel Ch. 2] Frank Pfenning Carnegie

More information

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)

More information

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming OpenGL 3D Drawing 2 3D Graphics Projections Getting 3D to 2D 3D scene 2D image 3 Projections Orthographic

More information

Visualizing Molecular Dynamics

Visualizing Molecular Dynamics Visualizing Molecular Dynamics Aiichiro Nakano Collaboratory for Advanced Computing & Simulations Department of Computer Science Department of Physics & Astronomy Department of Chemical Engineering & Materials

More information

Lectures OpenGL Introduction

Lectures OpenGL Introduction Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is

More information

Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D

Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D CS334 Spring 2012 Daniel G. Aliaga Department of Computer Science Purdue University Computer Graphics Pipeline Geometric Primitives

More information

1 (Practice 1) Introduction to OpenGL

1 (Practice 1) Introduction to OpenGL 1 (Practice 1) Introduction to OpenGL This first practical is intended to get you used to OpenGL command. It is mostly a copy/paste work. Try to do it smartly by tweaking and messing around with parameters,

More information

GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW

GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW OpenGL Syntax Functions have prefix gl and initial capital letters for each word glclearcolor(), glenable(), glpushmatrix() glu for GLU functions glulookat(), gluperspective() constants begin with GL_,

More information

An Interactive Introduction to OpenGL Programming

An Interactive Introduction to OpenGL Programming An Interactive Introduction to OpenGL Programming Course # 29 Dave Shreiner Ed Angel Vicki Shreiner Table of Contents Introduction...iv Prerequisites...iv Topics...iv Presentation Course Notes...vi An

More information

Understand how real-world lighting conditions are approximated by OpenGL

Understand how real-world lighting conditions are approximated by OpenGL OpenGL Programming Guide (Addison-Wesley Publishing Company) Chapter 5 Lighting Chapter Objectives After reading this chapter, you ll be able to do the following: Understand how real-world lighting conditions

More information

Introduction to OpenGL

Introduction to OpenGL Introduction to OpenGL Banafsheh Azari http://www.uni-weimar.de/cms/medien/cg.html What You ll See Today What is OpenGL? Related Libraries OpenGL Command Syntax B. Azari http://www.uni-weimar.de/cms/medien/cg.html

More information

Lectures Display List

Lectures Display List Lectures Display List By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is it? What

More information

Lectures Transparency Case Study

Lectures Transparency Case Study Lectures Transparency Case Study By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 How

More information

Exercise 1 Introduction to OpenGL

Exercise 1 Introduction to OpenGL Exercise 1 Introduction to OpenGL What we are going to do OpenGL Glut Small Example using OpenGl and Glut Alexandra Junghans 2 What is OpenGL? OpenGL Two Parts most widely used and supported graphics API

More information

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Bing-Yu Chen National Taiwan University Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

More information

Books, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt

Books, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt Books, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt CS334 Fall 2015 Daniel G. Aliaga Department of Computer Science Purdue University Books (and by now means complete ) Interactive Computer

More information

Computer Graphics Course 2005

Computer Graphics Course 2005 Computer Graphics Course 2005 Introduction to GLUT, GLU and OpenGL Administrative Stuff Teaching Assistant: Rony Goldenthal Reception Hour: Wed. 18:00 19:00 Room 31 (Ross 1) Questions: E-mail: cg@cs Newsgroups:

More information

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 Reading: See any standard reference on OpenGL or GLUT. Basic Drawing: In the previous lecture, we showed how to create a window in GLUT,

More information

Matrix-Rechnung I ' z =... Universität Frankfurt

Matrix-Rechnung I ' z =... Universität Frankfurt Matrix-Rechnung I x =Ax = = 1.................................... ' ' ' ' ' 44 41 14 11 z y x a a a a w z y x Matrix-Rechnung II Matrixmultiplikation ist assoziativ, abernicht kommutativ. OpenGL multipliziert

More information

Computer Graphics. Transformations. CSC 470 Computer Graphics 1

Computer Graphics. Transformations. CSC 470 Computer Graphics 1 Computer Graphics Transformations CSC 47 Computer Graphics 1 Today s Lecture Transformations How to: Rotate Scale and Translate 2 Introduction An important concept in computer graphics is Affine Transformations.

More information

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches: Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000

More information

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library. CS4202: Test Name: 1. Write the letter corresponding to the library name next to the statement or statements that describe library. (4 points) A. GLUT contains routines that use lower level OpenGL commands

More information

OpenGL: A Practical Introduction. (thanks, Mark Livingston!)

OpenGL: A Practical Introduction. (thanks, Mark Livingston!) OpenGL: A Practical Introduction (thanks, Mark Livingston!) Outline What is OpenGL? Auxiliary libraries Basic code structure Rendering Practical hints Virtual world operations OpenGL Definitions Software

More information

Advanced Computer Graphics (CS & SE )

Advanced Computer Graphics (CS & SE ) Advanced Computer Graphics (CS & SE 233.420) Topics Covered Picking Pipeline Viewing and Transformations Rendering Modes OpenGL can render in one of three modes selected by glrendermode(mode) GL_RENDER

More information

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics. Overview (1): Getting Started Setting up OpenGL/GLUT on Windows/Visual Studio COSC 4431/5331 Computer Graphics Thursday January 22, 2004 Overview Introduction Camera analogy Matrix operations and OpenGL

More information

Teacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using

Teacher Assistant : Tamir Grossinger   Reception hours: by  - Building 37 / office -102 Assignments: 4 programing using Teacher Assistant : Tamir Grossinger email: tamirgr@gmail.com Reception hours: by email - Building 37 / office -102 Assignments: 4 programing using C++ 1 theoretical You can find everything you need in

More information

An Interactive Introduction to OpenGL and OpenGL ES Programming. Ed Angel Dave Shreiner

An Interactive Introduction to OpenGL and OpenGL ES Programming. Ed Angel Dave Shreiner An Interactive Introduction to OpenGL and OpenGL ES Programming Ed Angel Dave Shreiner Welcome This morning s Goals and Agenda Describe the OpenGL APIs and their uses Demonstrate and describe OpenGL s

More information

Display Lists in OpenGL

Display Lists in OpenGL Display Lists in OpenGL Display lists are a mechanism for improving performance of interactive OpenGL applications. A display list is a group of OpenGL commands that have been stored for later execution.

More information

Transformation, Input and Interaction. Hanyang University

Transformation, Input and Interaction. Hanyang University Transformation, Input and Interaction Hanyang University Transformation, projection, viewing Pipeline of transformations Standard sequence of transforms Cornell CS4620 Fall 2008 Lecture 8 3 2008 Steve

More information

Scientific Visualization Basics

Scientific Visualization Basics Scientific Visualization Basics Aiichiro Nakano Collaboratory for Advanced Computing & Simulations Dept. of Computer Science, Dept. of Physics & Astronomy, Dept. of Chemical Engineering & Materials Science,

More information

12. Selection. - The objects selected are specified by hit records in the selection buffer. E.R. Bachmann & P.L. McDowell MV 4202 Page 1 of 13

12. Selection. - The objects selected are specified by hit records in the selection buffer. E.R. Bachmann & P.L. McDowell MV 4202 Page 1 of 13 12. Selection Picking is a method of capturing mouse clicks at some window position and determining what objects are beneath it. The basic idea is to enter the selection rendering mode with a small viewing

More information

Lighting. Chapter 5. Chapter Objectives. After reading this chapter, you'll be able to do the following:

Lighting. Chapter 5. Chapter Objectives. After reading this chapter, you'll be able to do the following: Chapter 5 Lighting Chapter Objectives After reading this chapter, you'll be able to do the following: Understand how real-world lighting conditions are approximated by OpenGL Render illuminated objects

More information

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011 CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011 Lab 1a of 7 OpenGL Setup and Basics Fri 28 Jan 2011 Part 1a (#1 5) due: Thu 03 Feb 2011 (before midnight) The purpose of this

More information

/opengl/docs/man_pages/hardcopy/gl/html/gl/

/opengl/docs/man_pages/hardcopy/gl/html/gl/ Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ Name Last modified Size Description Parent Directory accum.html 09-Sep-97 16:16 5K alphafunc.html

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 http://www.opengl.org Todays lecture What is OpenGL? HowdoI useit? Rendering pipeline Points, vertices, lines, polygons Matrices and transformations Lighting and shading Code examples

More information

CS559: Computer Graphics. Lecture 12: OpenGL Transformation Li Zhang Spring 2008

CS559: Computer Graphics. Lecture 12: OpenGL Transformation Li Zhang Spring 2008 CS559: Computer Graphics Lecture 2: OpenGL Transformation Li Zhang Spring 28 Today Transformation in OpenGL Reading Chapter 3 Last time Primitive Details glpolygonmode(glenum face, GLenum mode); face:

More information

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Describe the Orthographic and Perspective projections. How do we combine together transform matrices? Aims and objectives By the end of the lecture you will be able to Work with multiple transform matrices Describe the viewing process in OpenGL Design and build a camera control APIs Describe the Orthographic

More information

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1 Transformations 1-1 Transformations are used within the entire viewing pipeline: Projection from world to view coordinate system View modifications: Panning Zooming Rotation 1-2 Transformations can also

More information

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software

More information

OpenGL. What it is: Client-server model Network transparent. Computer Graphics

OpenGL. What it is: Client-server model Network transparent. Computer Graphics OpenGL OpenGL What it is: Software interface to graphics hardware ~ 120 C-callable routines for 3D graphics Hardware independent When running with X (with GLX extension) Client-server model Network transparent

More information

Computer Graphics Lighting

Computer Graphics Lighting Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Computer Graphics Lighting. Why Do We Care About Lighting?

Computer Graphics Lighting. Why Do We Care About Lighting? Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Computer Graphics 1 Computer Graphics 1

Computer Graphics 1 Computer Graphics 1 Projects: an example Developed by Nate Robbins Shapes Tutorial What is OpenGL? Graphics rendering API high-quality color images composed of geometric and image primitives window system independent operating

More information

Introduction to Computer Graphics with OpenGL/GLUT

Introduction to Computer Graphics with OpenGL/GLUT Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image

More information

C OMPUTER G RAPHICS Thursday

C OMPUTER G RAPHICS Thursday C OMPUTER G RAPHICS 2017.04.27 Thursday Professor s original PPT http://calab.hanyang.ac.kr/ Courses Computer Graphics practice3.pdf TA s current PPT not uploaded yet GRAPHICS PIPELINE What is Graphics

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs Graphics Pipeline & APIs CPU Vertex Processing Rasterization Fragment Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 11794--4400 Tel: (631)632-8450; Fax: (631)632-8334

More information

CS Computer Graphics: OpenGL, Continued

CS Computer Graphics: OpenGL, Continued CS 543 - Computer Graphics: OpenGL, Continued by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Last time. OpenGL set up Basic structure OpenGL skeleton Callback functions, etc. R.W.

More information

CS Computer Graphics: OpenGL, Continued

CS Computer Graphics: OpenGL, Continued CS 543 - Computer Graphics: OpenGL, Continued by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Last time. OpenGL set up Basic structure OpenGL skeleton Callback functions, etc. R.W.

More information

Grafica Computazionale

Grafica Computazionale Grafica Computazionale lezione36 Informatica e Automazione, "Roma Tre" June 3, 2010 Grafica Computazionale: Lezione 33 Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms

More information

Introduction to OpenGL and 3D Graphics

Introduction to OpenGL and 3D Graphics Introduction to OpenGL and 3D Graphics Categories Introduction to graphics The History of 3D Graphics How 3D Graphics work Drawing Points, Lines and Polygons in OpenGL Transformations and Perspective Introduction

More information

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely

More information

Texture Mapping. Mike Bailey.

Texture Mapping. Mike Bailey. Texture Mapping 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License TextureMapping.pptx The Basic Idea

More information

2. OpenGL -I. 2.1 What is OpenGL? Things OpenGL can do: -23-

2. OpenGL -I. 2.1 What is OpenGL? Things OpenGL can do: -23- 2.1 What is OpenGL? -23-2. OpenGL -I - Device-independent, application program interface (API) to graphics hardware - 3D-oriented - Event-driven Things OpenGL can do: - wireframe models - depth-cuing effect

More information

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3) Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics

More information

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 1 In this chapter, you will learn How to access values in the OpenGL state machine The types of primitives available in OpenGL How to

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs 3 2 4 Graphics Pipeline & APIs CPU Vertex Processing Rasterization Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

Introduction to OpenGL. CSCI 4229/5229 Computer Graphics Fall 2012

Introduction to OpenGL. CSCI 4229/5229 Computer Graphics Fall 2012 Introduction to OpenGL CSCI 4229/5229 Computer Graphics Fall 2012 OpenGL by Example Learn OpenGL by reading nehe.gamedev.net Excellent free tutorial Code available for many platforms and languages OpenGL:

More information

Computer Graphics. Chapter 7 2D Geometric Transformations

Computer Graphics. Chapter 7 2D Geometric Transformations Computer Graphics Chapter 7 2D Geometric Transformations Chapter 7 Two-Dimensional Geometric Transformations Part III. OpenGL Functions for Two-Dimensional Geometric Transformations OpenGL Geometric Transformation

More information

Assignment #6 2D Vector Field Visualization Arrow Plot and LIC

Assignment #6 2D Vector Field Visualization Arrow Plot and LIC Assignment #6 2D Vector Field Visualization Arrow Plot and LIC Due Oct.15th before midnight Goal: In this assignment, you will be asked to implement two visualization techniques for 2D steady (time independent)

More information

Graphics Programming

Graphics Programming Graphics Programming 3 rd Week, 2011 OpenGL API (1) API (application programming interface) Interface between an application program and a graphics system Application Program OpenGL API Graphics Library

More information

CONTENTS... 1 OPENGL REFERENCE MANUAL...

CONTENTS... 1 OPENGL REFERENCE MANUAL... Contents CONTENTS... 1 OPENGL REFERENCE MANUAL... 5 THE OFFICIAL REFERENCE DOCUMENT FOR OPENGL, RELEASE 1... 5 PREFACE... 6 WHAT YOU SHOULD KNOW BEFORE READING THIS MANUAL... 6 ACKNOWLEDGMENTS... 7 CHAPTER

More information

9. Display Lists. Display lists optimize performance by caching and saving end results, thus avoiding many intermediate steps for

9. Display Lists. Display lists optimize performance by caching and saving end results, thus avoiding many intermediate steps for 9. Display Lists OpenGL commands are normally executed in immediate mode A display list is a group of OpenGL commands that have been stored for later execution Display lists are used to - Cache commands

More information

Viewing Transformation

Viewing Transformation CS38: Computer Graphics Viewing Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Know camera setup parameters Understand viewing and projection processes

More information

CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II. Emmanuel Agu

CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II. Emmanuel Agu CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II Emmanuel Agu Recall: OpenGL Skeleton void main(int argc, char** argv){ // First initialize toolkit, set display mode and create window glutinit(&argc,

More information

Computer Graphics. Basic 3D Programming. Contents

Computer Graphics. Basic 3D Programming. Contents Computer Graphics Basic 3D Programming September 21, 2005 Sun-Jeong Kim 1 http://www.hallym.ac.kr/~sunkim/teach/2005/cga Contents Cameras and objects Perspective projections Orthographic projections Viewing

More information

Computer Graphics. Making Pictures. Computer Graphics CSC470 1

Computer Graphics. Making Pictures. Computer Graphics CSC470 1 Computer Graphics Making Pictures Computer Graphics CSC470 1 Getting Started Making Pictures Graphics display: Entire screen (a); windows system (b); [both have usual screen coordinates, with y-axis y

More information

Letterkenny Institute of Technology

Letterkenny Institute of Technology Letterkenny Institute of Technology BSc in Computing in Games Development Subject: Computer Graphics for Games Programming 2 Level: 7 Date: January 2008 Examiners: Dr. J.G. Campbell Dr. M.D.J. McNeill

More information

OpenGL Transformations

OpenGL Transformations OpenGL Transformations R. J. Renka Department of Computer Science & Engineering University of North Texas 02/18/2014 Introduction The most essential aspect of OpenGL is the vertex pipeline described in

More information