section01 introduction to opengl
TRANSCRIPT
-
7/26/2019 Section01 Introduction to OpenGL
1/14
Prepared By: Abdalla Essam Abdalla
-
7/26/2019 Section01 Introduction to OpenGL
2/14
What is OpenGL
Stands for OpenGraphics Library (OpenGL) is a
cross-language,
cross-platform(API) for rendering ! and "! vector graphics#
It is a soft$are interface to graphics hard$are# %he API is typically used to interact $ith a (GP&) Silicon Graphics Inc#, (SGI) started de'elopingOpenGL in and released it in *anuary+
-
7/26/2019 Section01 Introduction to OpenGL
3/14
Applications
applications use it extensively in the fields of :
computer-aided desin !"A#$
virtual reality
scientific visuali%ation
information visuali%ation
fliht simulation&
video ames
-
7/26/2019 Section01 Introduction to OpenGL
4/14
OpenGL Libraries
e use " sets of libraries in our OpenGLprograms
#.ore OpenGL (GL)
hundreds of commands begin $ith a prefi/ 0gl0
e#g# gl.olor, gl1erte/, gl%ranslate, gl2otate
models an ob3ect 'ia a set of geometric primiti'es
Such as points, lines, polygons
-
7/26/2019 Section01 Introduction to OpenGL
5/14
OpenGL Libraries
e use " sets of libraries in our OpenGL programs
# OpenGL &tility Library (GL&)
built on-top of the core OpenGL
Pro'ides important utilities
e#g# setting camera 'ie$ and pro3ection more building models
e#g# 4radric surfaces and polygon tessellation
start $ith a prefi/ 0glu0 e#g# gluLoo5At, gluPerspecti'e
-
7/26/2019 Section01 Introduction to OpenGL
6/14
OpenGL Libraries
e use " sets of libraries in our OpenGL programs
"# OpenGL &tilities %ool5it (GL&%)
OpenGL is designed to be independent of the $indo$ing system oroperating system#
GL&% Is needed to interact $ith the Operating System
e#g# creating a $indo$, handling 5ey and mouse inputs it pro'ides more building models
e#g# sphere and torus
start $ith a prefi/ of 0glut0
e#g# glut.reate$indo$, glut6ouse7unc
GL&% is platform independent, $hich is built on top of platform-specific OpenGL e/tension such as
GL8 for 8 indo$ System,
GL for 6icrosoft indo$, and
AGL, .GL or .ocoa for 6ac OS#
-
7/26/2019 Section01 Introduction to OpenGL
7/14
A Smidgen of OpenGL .ode
the basic structure of a simple proram can besimple'
(ts tas)s are to
initiali%e certain statesthat control ho* OpenGLrenders
specify ob+ects to be rendered'
-
7/26/2019 Section01 Introduction to OpenGL
8/14
A Smidgen of OpenGL .ode
-
7/26/2019 Section01 Introduction to OpenGL
9/14
A Smidgen of OpenGL .ode
initializes a window onthe screen
-
7/26/2019 Section01 Introduction to OpenGL
10/14
A Smidgen of OpenGL .ode
clear the window to black
-
7/26/2019 Section01 Introduction to OpenGL
11/14
A Smidgen of OpenGL .ode
establishes what color to use fordrawing objects
-
7/26/2019 Section01 Introduction to OpenGL
12/14
A Smidgen of OpenGL .ode
specifies the coordinatesystem
-
7/26/2019 Section01 Introduction to OpenGL
13/14
A Smidgen of OpenGL .ode
define the object to be drawn
-
7/26/2019 Section01 Introduction to OpenGL
14/14
A Smidgen of OpenGL .ode
ensures that the drawing commands are actuallyexecuted rather than stored in a buffer