OpenGL Help Session CS248 Fall 2006 Zhengyun Zhang.

Slides:



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

Basics. OpenGL. “Hello world” George Georgiev Telerik Corporation
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Today: - Make sure everyone is set up with an OpenGL environment - OpenGL basics:
What is OpenGL? Low level 2D and 3D Graphics Library Competitor to Direct3D (the rendering part of DirectX) Used in: CAD, virtual reality, scientific.
Introduction to Shader Programming
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
OpenGL Help Session CS248 Fall 2008 Derek Chan. OpenGL needs a windowing system OpenGL by itself does not talk to the windowing system/manager by itself.
Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction.
OpenGL Brian Farrimond Robina Hetherington. What is OpenGL A specification of a set of functions for drawing graphics –Names of functions –What information.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
Open Graphics Library (OpenGL)
Computer Graphics Bing-Yu Chen National Taiwan University.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
Programming in OpenGL Ryan Holmes CSE 570 February 12 th, 2003.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
COMP SCI 352 Computer Graphics and Animation. Computer Graphics2 My name is … My name is … How to find me How to find me Course Policies Course Policies.
OpenGL Shading Language (Advanced Computer Graphics) Ernest Tatum.
CSC 461: Lecture 41 CSC461: Lecture 4 Introduction to OpenGL Objectives: Development of the OpenGL API OpenGL Architecture -- OpenGL as a state machine.
Graphics Architectures & OpenGL API Introduction Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS 480/680 Computer Graphics Programming with Open GL Part 1: Background Dr. Frederick C Harris, Jr. Fall 2011.
Computer Graphics Tz-Huan Huang National Taiwan University.
Programming with OpenGL Part 1: Background
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics 靜宜大學 資訊工程系 蔡奇偉 副教授
CS 450: COMPUTER GRAPHICS PORTRAIT OF AN OPENGL PROGRAM SPRING 2015 DR. MICHAEL J. REALE.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics Ed Angel Professor Emeritus of Computer.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Modeler Help Session CSEP 557, Spring Help Session Overview The Modeler Application Modeler Code Overview Constructing Your Model Hierarchical Modeling.
Computer Graphics I, Fall 2008 Introduction to Computer Graphics.
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 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 CS4610/7610: Introduction to Computer Graphics.
CS 4363/6353 OPENGL BACKGROUND. WHY IS THIS CLASS SO HARD TO TEACH? (I’LL STOP WHINING SOON) Hardware (GPUs) double in processing power ever 6 months!
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 1: Background Ed Angel Professor Emeritus.
CPSC 453 Tutorial Xin Liu Sep 23, OpenGL An open standard of rendering pipeline A software interface to graphics hardware A useful set of APIs for.
Control flow for interactive applications CSE 3541 Matt Boggus.
Lecture 2: Some definitions of terms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Introduction to OpenGL. OpenGL is a low-level graphics library specification. It makes available to the programmer  a small set of geometric primitives.
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?
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
NoufNaief.net TA: Nouf Al-harbi.
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Introduction to OpenGL (INF 250) Veronika Solteszova et al., UiB Dept. of Informatics,
Computer Science – Game DesignUC Santa Cruz Tile Engine.
OpenGL: The Open Graphics Language Technology and Historical Overview By Ricardo Veguilla.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Lecture 8: Discussion of papers OpenGL programming Lecturer: Simon Winberg Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
School of Computer Science
Introduction to Computer Graphics
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
Introduction to Computer Graphics with WebGL
Modeler Help Session CSE 457, Autumn 2008
Introduction to Computer Graphics with WebGL
Modeler Help Session CSE 457, Spring 2005
Introduction to Computer Graphics
Introduction to Computer Graphics
Programming with OpenGL Part 1: Background
Programming with OpenGL Part 3: Shaders
Introduction to OpenGL
OpenGL Background CS 4722.
OpenGL-Rendering Pipeline
Prepared by your friendly, phantom TA Jennifer
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

OpenGL Help Session CS248 Fall 2006 Zhengyun Zhang

References OpenGL Programming Guide (Red Book) start here OpenGL Reference Guide (Blue Book) use this to look up individual functions OpenGL Shading Language (Orange Book) gets you started with GLSL

OpenGL is a state machine States like projection matrix, current vertex color, etc. We can change the states by using GL function calls like glPushMatrix. The state is used when we are drawing primitives.

OpenGL needs to be connected to the windowing system OpenGL by itself does not talk to the windowing system/manager by itself. Need a toolkit to tell the windowing system that we need an OpenGL window. Examples: GLUT (used in Project 2) SDL (recommended for Project 3) wxWidgets, Qt (full fledged widget toolkits, probably overkill for a game)

OpenGL function suffixes OpenGL functions that take different types of arguments while providing the same functionality will often have a suffix to denote which type of function they are: glVertex2i - input is 2 integers glVertex3fv - input is 3 floats in an array glVertex3f - input is 3 floats

OpenGL function suffixes Extensions to the OpenGL base system often have their own suffixes. For example: glCreateProgramObjectARB (to create a shader program using an ARB extension) Use GLEW (OpenGL Extension Wrangler) for easy access to extensions.

Other OpenGL Hints OpenGL uses a right-handed coordinate system. Light positions are not sent through the Model- View matrix. Projection matrix should only be used for camera position, etc. It has a shorter stack than the Model- View matrix. New matrix is multiplied on the right. Latest matrix to be multiplied on is the first operation to be performed on the vertex locations.

Basic OpenGL Game Flowchart 1. Load up an OpenGL window using a toolkit to talk to the windowing system 2. Set up projection matrices, shading properties, etc. Load textures, etc. 3. Event loop: 1. Check for any events or user input and process them 2. Redraw the OpenGL scene as necessary 3. Wait a small amount of time.

Sample OpenGL Program Based on the example SDL application Andrew wrote that’s linked off the project 3 handout: /SDLDemo.zip /SDLDemo.zip I’m going to demonstrate a Python version, but the overall structure of the program should be the same.