OpenGl Graphics Programming. Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric.

Slides:



Advertisements
Similar presentations
Chapter 2: Graphics Programming
Advertisements

Pemrograman OpenGL Dasar
OpenGL (Graphics Library) Software Interface to graphics software Allows to create interactive programs that produce color images of moving 3D objects.
Introduction to Computer Graphics (CMPS 160-Lab, Fall -2007)
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
30/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 1: Introduction.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Introduction to OpenGL. What is OpenGL OpenGL is a low-level software interface to graphics hardware No commands for performing windowing tasks or obtaining.
CMPE 466 COMPUTER GRAPHICS
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
LAB #1: Computer Graphics Framework IGX is a set of programs which allow you to write graphics programs in C/C++ from plain text files. Benefits: 1. You.
OpenGL Brian Farrimond Robina Hetherington. What is OpenGL A specification of a set of functions for drawing graphics –Names of functions –What information.
Development of Interactive 3D Virtual World Applications
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Introduction to OpenGL Keng Shih-Ling 2003 Spring.
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
CSE328:Computer Graphics OpenGL Tutorial Dongli Zhang Department of Computer Science, SBU Department of Computer Science, Stony.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP4730: Computational Structures in Computer Graphics Introduction to OpenGL.
Basic OpenGL Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, September 10, 2003.
Linear Interpolation, Brief Introduction to OpenGL Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, September.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
Using OpenGL in Visual C++ Opengl32.dll and glu32.dll should be in the system folder Opengl32.dll and glu32.dll should be in the system folder Opengl32.lib.
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.
Graphics Programming using OpenGL. OpenGL is a software interface that allows the programmer to create 2D and 3D graphics images. This interface consists.
Programming with OpenGL Part 1: Background
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
1 Chapter 7 Operating System & Utility Programs.  consists of the programs that control or maintain the operations of the computer and its devices. It.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
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. 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,
ROOT Team Meeting October 1 st 2010 GUI thinking and testing ideas OpenGL GUI Root Team meeting 01/10/2010.
Introduction to OpenGL Programming Jian-Liang Lin 2002.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 1: Background Ed Angel Professor Emeritus.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Affine Geometry Jehee Lee Seoul National University.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
In the name of God Computer Graphics.
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
CS 470 Computer Graphic Getting Started with OpenGL.
NoufNaief.net TA: Nouf Al-harbi.
CGGM Lab. Tan-Chi Ho Introduction to OpenGL.
Computer Graphics Lab 1 OpenGL.
1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set.
Graphics: Conceptual Model
Lecture 2: Introduction to OpenGL
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
Visualization Recreate the ping pong scene in 3D using ball and racket coordinates.
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
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.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
Khang Lam Daniel Limas Kevin Castillo Juan Battini
Introduction to OpenGL (IDE: Eclipse)
In the name of God Computer Graphics.
Programming with OpenGL Part 1: Background
School of Computer Science
Introduction to Operating System (OS)
“Computer Science is no more about computers than astronomy is about telescopes.” Professor Edsger Dijkstra.
Web App vs Mobile App.
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
Programming with OpenGL Part 1: Background
Introduction to OpenGL
Programming with OpenGL Part 1: Background
Programming with OpenGL Part 1: Background
Introduction to OpenGL Programming
Presentation transcript:

OpenGl Graphics Programming

Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric primitives - points, lines, polygons, images, and bitmaps. OpenGL provides a set of commands that allow the specification of geometric objects in two or three dimensions, using the provided primatives, together with commands that control how these objects are rendered (drawn).

What Is OpenGl GL stand for Graphics library. OpenGL is a software interface to graphics hardware. This interface consists of about 150 distinct commands that you use to specify the objects and operations needed to produce interactive three-dimensional applications. OpenGL is hardware-independent interface that can be implemented on many different hardware platforms. The portability of OpenGl led to its rapid acceptance as a standard for computer graphics programming.

What Is OpenGl OpenGL itself isn’t a programming language, or a software library. It’s the specification of an Application Programming Interface (API) for computer graphics programming. In other words, OpenGL defines a set of functions for doing computer graphics.

What exactly can OpenGL do? It provides 3D geometric objects, such as lines, polygons, triangle meshes, cubes, curves and surfaces. It provides 3D modeling transformations, and viewing functions to create views of 3D scenes using the idea of a virtual camera; It supports the manipulation of images as pixels.

With OpenGL, you must build up your desired model from a small set of geometric primitives – points, lines, and polygons.

OpenGl Libraries Two utility libraries have been developed which extend the low- level functionality of OpenGL. GLU Is the OpenGL Utility Library, provides functions for drawing more complex primitives than those of OpenGL, such as curves and surfaces. All GLU function names start with “glu”.

GLUT provides the facilities for interaction that OpenGL lacks. It provides functions for managing windows on the display screen, and handling input events from the mouse and keyboard. All GLUT function names start with “glut”.

This collection Of libraries Refereed to as” OpenGl” OpenGL” is actually a set of three libraries: OpenGL itself,and the supporting libraries GLU and GLUT. Application Program GLU GLUT OpenGL library Unix X Windows

The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces (GUIs) and rich input device capability for networked computers.

The OpenGl Model Application Model Application Program Graphic System(OpenGl) Display ScreenMouse,… User

Include Files For all OpenGL applications, you want to include the gl.h header file in every file. Almost all OpenGL applications use GLU, the aforementioned OpenGL Utility Library, which also requires inclusion of the glu.h header file. So almost every OpenGL source file begins with: #include #include If you are using the OpenGL Utility Toolkit (GLUT) for managing your window manager tasks, you should include: #include Note that glut.h guarantees that gl.h and glu.h are properly included for you so including these three files is redundant. To make your GLUT programs portable, include glut.h and do not include gl.h or glu.h explicitly.

Setting Up Compilers Windows Using MS Visual C++ Most of the following files (ie. OpenGL and GLU) will already be present if you have installed MS Visual C++ v5.0 or later. The following GLUT files will need to be copied into the specified directories.

libraries (place in the lib\ subdirectory of Visual C++) opengl32.lib glu32.lib glut32.lib include files (place in the include\GL\ subdirectory of Visual C++) gl.h glu.h glut.h dynamically-linked libraries (place in the \Windows\System subdirectory opengl32.dll glu32.dll glut32.dll

Compiling OpenGL/GLUT Programs Create a new project: choose File | New from the File Menu select the Projects tab choose Win32 Console Application fill in your Project name

A Description of an OpenGl Function Example: the definition of the GLUT function which draws a sphere. void glutWireSphere ( GLdouble radius, GLint slices, GLint stacks );

The name of the function is glutWireSphere(); The result type of the function is void; The function has three arguments: – radius, of type GLdouble – slices, of type GLint – stacks, of type GLint

To actually use this function in your program,you have to declare variables GLint sl= 15; GLdouble rad= 1.0; GLint st= 20; glutWireSphere (rad, sl, st); Or, you could set the arguments directly, without declaring variables: glutWireSphere (1.0, 15, 20);