 “OpenGL (Open Graphics Library) is a standard specification defining a cross- language cross-platform API for writing applications that produce 2D and.

Slides:



Advertisements
Similar presentations
Computer Graphics - Graphics Programming -
Advertisements

Department of nskinfo i-education
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
OpenGL CMSC340 3D Character Design & Animation. What is OpenGL? A low-level graphics library specification designed for use with the C and C++ provides…
OPEN GL. Install GLUT Download package di sini Dari devcpp, buka Tools->PackageManager-
Lecture 3 Graphics Pipeline and Graphics Software
Chapter 2: Graphics Programming
Computer Graphics CSCE 441
TOPIC 3 INTRODUCTION TO OPENGL CGMB214: Introduction to Computer Graphics.
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
What is OpenGL? Low level 2D and 3D Graphics Library Competitor to Direct3D (the rendering part of DirectX) Used in: CAD, virtual reality, scientific.
OpenGL Basics Donghui Han. Assignment Grading Visual Studio Glut Files of four types needed: – Source code:.cpp,.h – Executable file:.exe (build in release.
OpenGL Basics.
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.
#4: OpenGL Implementation & Project 2 CSE167: Computer Graphics TAs: Alex Kozlowski & Cameron Chrisman UCSD, Winter 2006.
InteractionHofstra University1 Graphics Programming Input and Interaction.
CSE 494/598 Intro to Applied Computer Graphics Anshuman Razdan DCST AR's Web Page AR's Web Page
Based on slides created by Edward Angel
Computer Graphics CS 385 February 7, Fundamentals of OpenGl and Glut Today we will go through the basics of a minimal OpenGl Glut project, explaining.
Development of Interactive 3D Virtual World Applications
Write a Simple Program with OpenGL & GLUT. Books and Web Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible.
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.
Chapter 03: Graphics Primitives Course web page: Chapter #3.
Reference1. [OpenGL course slides by Rasmus Stenholt]
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Graphics Programming and OpenGL.
Computer Graphics Bing-Yu Chen National Taiwan University.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
Lecture 3 OpenGL.
Computer Graphics I, Fall 2010 Input and Interaction.
Write a Simple Program with OpenGL & GLUT. Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible
1 Figures are extracted from Angel's book (ISBN x) The Human Visual System vs The Pinhole camera Human Visual System Visible Spectrum Pinhole.
Managing Multiple Windows with OpenGL and GLUT
CS 480/680 Computer Graphics Programming with Open GL Part 7: Input and Interaction Dr. Frederick C Harris, Jr. Fall 2011.
OpenGL Programming Related Links The Official OpenGL Website OpenGL v1.1 Redbook
Interactive Computer Graphics CS 418 MP1: Dancing I TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz Slides Taken from: “An Interactive Introduction to OpenGL.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
1 Input and Interaction. 2 Objectives Introduce the basic input devices ­Physical Devices ­Logical Devices ­Input Modes Event-driven input Introduce double.
Intro to OpenGL (Version 2) Geb Thomas. Setting Up GLUT You will need GLUT for opening windows We can use the version made by Nate Robins: –
Computer Graphics I, Fall 2010 Working with Callbacks.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- Programming with OpenGL 2.
University of New Mexico
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
NoufNaief.net TA: Nouf Al-harbi.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
Introduction to OpenGL Programming
OpenGL Basic Drawing 2003 Spring Keng Shih-Ling
CS552: Computer Graphics Lecture 6: Viewing in 2D.
Chap 2 Write a Simple OpenGL Program. Preparing 1/2 environment : Microsoft Visual C 、 Microsoft Visual C++.Net Also need : GLUT
12/22/ :38 1 Comp 175C - Computer Graphics Dan Hebert Computer Graphics Comp 175 Chapter 3 Instructor: Dan Hebert.
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.
SPACE SHUTTLE LAUNCHING GUIDE Mis. V.R.PRATIMA Mr. ASWIN KUMAR PUNITH.K PAUL SUDEEP.G Submitted by.
Introduction to Graphics Programming. Graphics API.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL: Event-driven How in OpenGL? Programmer registers callback functions Callback function called when.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Working with Callbacks.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
INTRODUCTION TO OPENGL
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Basic Program with OpenGL and GLUT
Introduction to OpenGL
Computer Graphics Lecture 33
The User Interface Lecture 2 Mon, Aug 27, 2007.
גרפיקה ממוחשבת: מבוא ל-OpenGL
Screen/Window coordinates
Introduction to OpenGL
Input and Interaction Ed Angel
Managing Multiple Windows with OpenGL and GLUT
Presentation transcript:

 “OpenGL (Open Graphics Library) is a standard specification defining a cross- language cross-platform API for writing applications that produce 2D and 3D computer graphics.” – from Wikipediacross-platformAPI2D3D computer graphics  State machine  For example, set the color, all subsequent drawing will be in this color until you change the color.

 The OpenGL Utility Library (GLU)  Routines that accomplishes some tasks by calling low-level OpenGL commands  Provided as part of OpenGL implementation  Prefix: glu  The OpenGL Utility Toolkit (GLUT)  window system-independent toolkit  Prefix: glut

 The Red book   The website 

 #include  Put it before stdlib.h

 glutInit(int *argc, char **argv) initializes. glutInit() should be called before any other GLUT routine.  glutInitDisplayMode(unsigned int mode) specifies whether to use an RGBA or color-index color model. For example, a window with double buffering, the RGBA color model, and a depth buffer: glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH).  glutInitWindowPosition(int x, int y) specifies the screen location for the upper-left corner of your window.  glutInitWindowSize(int width, int size) specifies the size, in pixels, of your window.  int glutCreateWindow(char *string) creates a window with an OpenGL context.

 glutDisplayFunc(void (*func)(void)).Whenever GLUT determines the contents of the window need to be redisplayed, the callback function registered by glutDisplayFunc() is executed. Therefore, you should put all the routines you need to redraw the scene in the display callback function.  If your program changes the contents of the window, sometimes you will have to call glutPostRedisplay(void), which gives glutMainLoop() a nudge to call the registered display callback at its next opportunity.

 glutMainLoop() is the last to be called, and it is never exited once entered.  Things that only need to be done once should be called only once in init().  More on GLUT  tml tml

 Mouse input  Button clicking ▪ void glutMouseFunc(void (*func)(int button, int state, int x, int y))  Motion ▪ glutMotionFunc( void (*func)(int x, int y))  Keyboard input  Key pressing ▪ void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y))  Window resizing  void glutReshapeFunc(void (*func)(int w, int h))

 Rotate  void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);  Translate  void glTranslatef (GLfloat x, GLfloat y, GLfloat z);  Scale  void glScalef(GLfloat x, GLfloat y, GLfloat z);

 Backface Culling  void glCullFace(GLenum mode);  glEnable(GL_CULL_FACE);  Cull faces that are facing back based on vertex normals  View frustum culling   Big models (PLY)

 User input  Backface culling  View-frustum culling