CD2012 Principles of Interactive Graphics Lecture 01 Introduction Abir Hussain (Rome: 6.33,Tel. 01512312458, Web:

Slides:



Advertisements
Similar presentations
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
Advertisements

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-
Chapter 2: Graphics Programming
Computer Graphics CSCE 441
Pemrograman OpenGL Dasar
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
Lab 1: OpenGL Tutorial CS 282. What’s the plan for today? Go over our framework code. Learn some basic OpenGL! Reveal Lab 1 Answer questions.
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 (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.
CSC 461: Lecture 51 CSC461 Lecture 5: Simple OpenGL Program Objectives: Discuss a simple program Discuss a simple program Introduce the OpenGL program.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
Device Independent Graphics and OpenGL
30/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 1: Introduction.
ITEPC 06 - Workshop on Fractal Creation Chiew-Lan Tai and Oscar Au.
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
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.
Write a Simple Program with OpenGL & GLUT. Books and Web Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible.
Programming with OpenGL and GLUT
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.
2003CS Hons RW778 Graphics1 Chapter 1: Introduction Admin: Admin: –Lecture slots: Monday 8-9:45, Tuesday 9:15-11:00. –Book: F. Hill, Computer Graphics.
Foundation Programming Introduction. Aims This course aims to give students a basic understanding of computer programming. On completing this course students.
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.
Geometric Primitives Used in Open GL Polygons Polygon is : Flat shape with three or more straight sides. It could be either : convex or concave.
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.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Lecture 1: Introduction. Pick Your Version of GLUT OpenGL and the GLUT are available for Windows, Linux and many other Operating Systems and platforms.
Programming with OpenGL Part 1: Background
Lecture 3 OpenGL.
Write a Simple Program with OpenGL & GLUT. Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
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 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);
Lecture 11: Exam Revision 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271  Coursework.
Introduction to Computer Graphics 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Programming with OpenGL Review.
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.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
NoufNaief.net TA: Nouf Al-harbi.
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
Doç. Dr. Cemil Öz SAÜ Bilgisayar Mühendisliği Dr. Cemil Öz.
Geometric Primitives Used in Open GL Drawing Triangles glBegin(GL_TRIANGELS); glVertex2i(p0); glVertex2i(p1); glVertex2i(p2); glVertex2i(p3); glVertex2i(p4);
Introduction to OpenGL Programming
31/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 2: Introduction.
Introduction to OpenGL Muhammad Aamir Khan Lecturer, DCS, UOP.
Introduction to Graphics Programming. Graphics API.
Graphics Graphics Korea University kucg.korea.ac.kr Graphics Programming 고려대학교 컴퓨터 그래픽스 연구실.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL: Event-driven How in OpenGL? Programmer registers callback functions Callback function called when.
INTRODUCTION TO OPENGL
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.
CS4610/7610: Introduction to Computer Graphics
Graphics Programming (I)
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
Starting to draw dealing with Windows which libraries? clipping
גרפיקה ממוחשבת: מבוא ל-OpenGL
Drawing in the plane 455.
Introduction to OpenGL
OpenGL program.
Starting to draw dealing with Windows which libraries? clipping
Presentation transcript:

CD2012 Principles of Interactive Graphics Lecture 01 Introduction Abir Hussain (Rome: 6.33,Tel , Web:

© JMU, 2003CD Introduction Teaching by lectures and laboratories. –the materials are practical –Core for BSc Multimedia Systems and Computer Games Technology –Elective for other programmes - SE2, CS2 60% Coursework (2), 40% Exam Recommended book: Open GL programming Guide, third edition, by Mason Woo, Addison Wesley.

© JMU, 2003CD Introduction

© JMU, 2003CD Today’s Lecture and Lab Aims and objectives of the module Outline what you should already know Outline the resources we will be using in the module Introducing OpenGL – Compile our first program – Modify the program to do something interesting

What are the aims of the module?

© JMU, 2003CD Aims To explain the principles underlying interactive computer graphics –via practical examples and explanations of basic algorithms To develop programming skills in Computer Graphics –using the OpenGL graphics library Introduce input and display technologies for Computer Graphics

© JMU, 2003CD Objectives? Learning Outcomes - once we have finished you should be able to 1 Identify the hardware and software needed for Computer Graphics applications 2 Solve problems in 2D graphics and interaction 3 Develop applications using 2D graphics and 2D input devices 4 Explain the principles behind 2D and 3D graphics The Coursework will test 2, 3 and 4 and the exam will test 1, 2 and 4

© JMU, 2003CD Module You are expected to know C as taught in CD1003 and CD1004. –You will need this knowledge for most of your other Level 2 modules. –You are recommended to revise C programming. For suggested revision topics go through the followings: 1. Functions and parameter passing 2. Returning values from functions 3. Arrays and structure data types 4. Compiling and debugging

© JMU, 2003CD Resources OpenGL and Visual C++ can be used in 6th and 7th Floor Labs. We will use the GLUT library with OpenGL so we are independent of MS Windows. –Examples should run on Linux with OpenGL. –For more information on how to run OpenGL on Linux and for OpenGL online tutorials see In this course, we are starting at a higher-level than most traditional Computer Graphics courses.

© JMU, 2003CD Resources Most of the information on OpenGL will come from handouts but you are expected to do your own reading. Information on algorithms will come from handouts and from “Foley and van Dam, Computer Graphics: Principles and Practice (available in cheaper student edition)”

© JMU, 2003CD Anatomy of an Interactive Graphics Program Every interactive graphics program has the same basic outlines, which are: –Initialise the application data and graphics environment –Create the contents of the display –Paint the contents of the display on a window –Set-up functions to handle input events –Start an infinite loop to handle input events

© JMU, 2003CD Anatomy of an Interactive Graphics Program This is event-driven programming. –This means that the program responds to various events such as the press of a key in the keyboard or the resizing of the window on the screen. –The programmer is organising the program as a set of callback functions which are executed when an events are occurred. In OpenGL there is Utility Toolkit, which provides tools to help with managing events. As an example: glutDisplayFunc(myDisplay); //register the //redraw function registers the function myDisplay() as the function to be executed for drawing on the display.

© JMU, 2003CD Drawing basic graphics primitives a simple OpenGL program that let us draw three dots on a window. OpenGL provides tools for drawing points, lines, polylines and polygons using a list of vertices. –This occurs between two functions which are the glBegin() and glEnd()

© JMU, 2003CD Drawing basic graphics primitives Example: void myDisplay(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINE_LOOP); glVertex2i(100,50); glVertex2i(100, 130); glVertex2i(150, 130); glVertex2i(300,300); glEnd(); glFlush(); }

© JMU, 2003CD Drawing basic graphics primitives To establish the coordinates systems, a function myInit() is a good place for establishing all the required coordinate systems. void myInit(void) { glClearColor(0.0,1.0,1.0, 1.0); //set white background //colour glColor3f(0.0f, 0.0f, 0.0f); //set the drawing //colour glPointSize(4.0); //set the size of the //points glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 640.0, 0.0, 480.0);//set the size of the //window }

© JMU, 2003CD Drawing basic graphics primitives Before a program can be started some header file should be included such as: #include the windows header file since this is a window’s program. #include the application programming interface #include the OpenGL utility library # include the OpenGL utility toolkit which is a windowing tools for handling window system operations.

© JMU, 2003CD Drawing basic graphics primitives In the main function, the first five functions use the OpenGL utility toolkit to open a window for drawing. –The remaining functions in main() register the callback function and then start the main event loop processing. void main (int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE| GLUT_RGB); glutInitWindowSize(640, 480); glutInitWindowPosition(100,150); glutCreateWindow("my first attempt"); glutDisplayFunc(myDisplay); myInit(); glutMainLoop(); }

© JMU, 2003CD Summary Module Overview –Syllabus –assessment outline What is an OpenGL? –purpose and functions Drawing basic graphics primitives