Computer Graphics Practical Lesson 1-

Slides:



Advertisements
Similar presentations
Computer Graphics - Graphics Programming -
Advertisements

Department of nskinfo i-education
OpenGL CMSC340 3D Character Design & Animation. What is OpenGL? A low-level graphics library specification designed for use with the C and C++ provides…
School of Computer Science University of Seoul. How can we create a window? How can we handle the events? What kind of objects can we render? How can.
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
#include int line_width = 1; void Display( void ) { glEnable( GL_LINE_STIPPLE ); glClearColor (0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT);
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.
#4: OpenGL Implementation & Project 2 CSE167: Computer Graphics TAs: Alex Kozlowski & Cameron Chrisman UCSD, Winter 2006.
CENG477 Introduction to Computer Graphics Introduction to OpenGL, GLUT and GLUI.
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.
Chapter 03: Graphics Primitives Course web page: Chapter #3.
OpenGL A Brief Overview. What is OpenGL?  It is NOT a programming language.  It is a Graphics Rendering API consisting of a set of function with a well.
Programming with OpenGL and GLUT
Reference1. [OpenGL course slides by Rasmus Stenholt]
CS380 LAB I OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Computer Graphics Bing-Yu Chen National Taiwan University.
1 Computer Graphics Dr. Amy Zhang Assistant Professor of Computer Science United International College.
CAP4730: Computational Structures in Computer Graphics Introduction to OpenGL.
1 GLUT Callback functions Event-driven: Programs that use windows  Input/Output  Wait until an event happens and then execute some pre-defined functions.
INTRO TO COMPUTER GRAPHICS TEXT EDWARD ANGEL: EDITION 5 CS770/870
Drawing Basic Graphics Primitives Lecture 4 Wed, Sep 3, 2003.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter 2 Initial Steps in Drawing Figures Ureerat Suksawatchon Faculty of Informatics.
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.
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.
CS 450: COMPUTER GRAPHICS INSTALLING GLUT AND GLEW SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics, KKU. Lecture 101 Introduction to OpenGL.
Computer Graphics CS 385 January 31, Fractals Some definitions Object which is self-similar at all scales. Regardless of scale the same level of.
 “OpenGL (Open Graphics Library) is a standard specification defining a cross- language cross-platform API for writing applications that produce 2D and.
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.
Introduction to GL Geb Thomas. Example Code int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
CS 480/680 Computer Graphics Programming with Open GL Part 7: Input and Interaction Dr. Frederick C Harris, Jr. Fall 2011.
Interactive Computer Graphics CS 418 MP1: Dancing I TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz Slides Taken from: “An Interactive Introduction to OpenGL.
Lecture 2: Some definitions of terms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
Uploading documents to the site Сlick “Add document” on the home page To send several files enable Add-on “Microsoft Office”
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
1 Graphics CSCI 343, Fall 2015 Lecture 3 Introduction to WebGL.
NoufNaief.net TA: Nouf Al-harbi.
Computer Graphics Lab 1 OpenGL.
CS 490 GRAPHICS COMPUTER Lecture 1: Introduction Computer Science Department 1.
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
CSCE 441: Computer Graphics
OpenGL Basic Drawing 2003 Spring Keng Shih-Ling
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.
Introduction to Graphics Programming. Graphics API.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Computer Graphics -practical- Lecture 6. (visual c++) open gl library To use open GL with VC++ we add these files:- 1)Glut.h C:\program files\ Microsoft.
The Human Visual System vs The Pinhole camera
CS380 Lab Spring Myungbae Son.
Introduction to OpenGL
Computer Graphics Lecture 33
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
OpenGL A Brief Overview.
Lab 3 Geometric Drawing Lab 3 Geometric Drawing.
גרפיקה ממוחשבת: מבוא ל-OpenGL
Coordinate Systems and Transforming the Coordinates
Drawing in the plane 455.
Introduction to OpenGL
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
OpenGL A Brief Overview.
Presentation transcript:

Computer Graphics Practical Lesson 1- Introduction to OpenGL Ayal Stein

Contact Info Teaching Assistance: Ayal Stein Phone number: 08-6477866 Course Site: www.cs.bgu.ac.il/~graph112 Email: ayals@cs.bgu.ac.il Room -102/37 Office Hours: ????

OpenGL OpenGL (Open Graphics Library) is cross-platform library to produce 2d and 3d graphics. It was developed during the 80’s until the early 90’s

Installing OpenGL Open the page “Files and Links” in the course site. Under section “Direct Download” – download the zip file from link “GLUT Binaries” Extract zip file into your code folder.

Installing OpenGL(cont’) The include directive #include <gl/glut.h> in our sample code is used when OpenGl is installed on system. To easily start working, you can replace the include directive to #include “glut.h” and copy glut files into project page: glut32.dll , glut32.lib , glut.h

OpenGL events OpenGL is windows based application. The flow of the program is based on events. We define functions to handle events.

Initialize Functions glutInit – GL defined function initialize the GL environment. glutCreateWindow – open the window glutInitDisplayMode – definitions like transparency and depth test. glutMainLoop –GUI main loop.

Events Functions Init function – function that opens the GL window and define events. glutDisplayFunc and glutIdleFunc – Draw function for window. glutReshapeFunc - Event for window resize.

Events Functions(cont’) glutMouseFunc – event for mouse click glutMotionFunc – event for mouse movements. glutKeyboardFunc – events for keyboard.

Drawing Basic Shapes Drawing 2 points: glBegin() - declare the shape type. glEnd() – end of drawing. Drawing 2 points: glBegin(GL_POINTS); glVertex3f(0.2f,0.8f,0.0f); glVertex3f(0.8f,0.2f,0.0f); glEnd();

Drawing Basic Shapes Basic types of shapes: GL_POINTS – draw isolated points GL_LINES – draw lines GL_TRIANGLES – triangles GL_QUADS – squares. And many more….

Design Pattern – State machine When working with GUI, we have state. In the first example, the first state draws a triangle. The second stage is drawing a square.

State Machine Example – MP3 Player

Design Pattern – State machine By mouse click, we switch to next state. There is a base class for state with virtual functions defined in it. Each state is represented by its own class. Each successor define its own functions.

First Assignment Expand the first example to draw a sixth shape. Draw a new shape in a new color. This is a warm up mission should not take you more than an hour. Submission is on next lesson.