11

Open gl introduction

Embed Size (px)

Citation preview

Page 1: Open gl introduction
Page 2: Open gl introduction

WHAT IS OPENGL?

“a software interface to graphics hardware.”

Low- level graphics API

Fast and portable 3D graphics library

NOTE: OpenGL is ONLY a graphics library

Page 3: Open gl introduction

3 OPENGL LIBRARIES

OpenGL (GL) – used in modeling an object via a set of geometric primitives such as point, line and polygon.

OpenGL Utility Library (GLU)- important utilities (such as setting camera view and projection) and more building models (such as quadric surfaces and polygon tessellation).

Page 4: Open gl introduction

OpenGL Utilities Toolkit (GLUT) – used for creating a window, handling key and mouse inputs. It also provides more building models (such as sphere and torus).

Page 5: Open gl introduction

HOW TO INCLUDE OPENGL LIBRARY

#include <gl/gl.h>

#include <gl/glu.h>

#include <gl/glut.h>

Page 6: Open gl introduction

#include <gl/freeglut.h>

Page 7: Open gl introduction

Silicon Graphics Inc. (SGI) used “IRIS GL”, a 3D programming API in their high-end IRIS graphics workstations.

When SGI tried porting IRIS GL to other hardware platforms problems occurred :(

OpenGL is the result of SGI’s efforts to improve IRIS GL’s portability (came out in 1992).

HISTORY

Page 8: Open gl introduction

OpenGL 1.x - fixed function

OpenGL 2.x - early programmable

OpenGL 3.x/4.x - modern programmable,Core profile and deprecation

OpenGL ES 1.x - mobile fixed function

OpenGL ES 2.x - mobile programmable

FIVE GENERATIONS OF OPENGL

Page 9: Open gl introduction

HOW OPENGL WORKS

OpenGL is a procedural rather than a descriptive graphics language.

Instead of describing the scene and how it should appear, the programmer actually describes the steps necessary to achieve a certain appearance or effect.

Page 10: Open gl introduction

DESCRIPTIVE

PROCEDURAL

Orange cube rotated at 90°

1. Rotate at 90°2. Orange3. Cube4. Vertex 1 at [-1,1,1]5. Vertex 2 at [1,1,1]6. …. 7. ….

Page 11: Open gl introduction

POPULAR OPENGL-BASED PROGRAMSAdobe After Effects

Autodesk Maya

Autodesk AutoCAD

Google Earth

Counter-Strike

Minecraft

Left 4 Dead 2

Portal2