3. Common Uses for Computer
Graphics
• Applications for real-time 3D graphics range from
interactive games and simulations to data visualization
for scientific, medical, or business uses
– Military flight simulators
– Computer-aided design (CAD)
– Architectural or civil planning
– Scientific visualization
– Entertainment
3Budditha Hettige
14. Graphics: Conceptual Model
Real Object
Real Object
Human Eye
Human Eye
Display
Device
Graphics System
Synthetic
Model
Synthetic
Camera
Real Light
Synthetic
Light Source
Budditha Hettige 14
15. OpenGL
• Standard specification defining a cross-language, cross-
platform API
• Is not a programming language
• Writing applications that produce 2D and 3D computer
graphics
• A software interface to graphics hardware
• Designed and optimized for the display and
manipulation of 3D graphics
• Developed by Silicon Graphics Inc. (SGI) in 1992
15Budditha Hettige
16. OpenGL-Graphics rendering API
• Rendering API
– High-quality color images composed of geometric
and image primitives
– Window system independent
– Operating system independent
• OpenGL Pipeline
16Budditha Hettige
19. OpenGL and Related APIs
19
GLUT
GLU
GL
GLX, AGL
or WGL
X, Win32, Mac O/S
software and/or hardware
application program
OpenGL Motif
widget or similar
Budditha Hettige
20. Related APIs
• AGL, GLX, WGL
– glue between OpenGL and windowing systems
• GLU (OpenGL Utility Library)
– part of OpenGL
– NURBS, tessellators, quadric shapes, etc.
• GLUT (OpenGL Utility Toolkit)
– portable windowing API
– not officially part of OpenGL
• Initial header inclusions (for Windows)
– #include<windows.h>
– #include<gl/gl.h>
– #include<gl/glu.h>
– #include <GL/glut.h>
20Budditha Hettige
21. Function-Naming Conventions
• All OpenGL functions take the following
format
<Library prefix><Root command><Optional argument
count><Optional argument type>
21Budditha Hettige
27. OpenGL 3-D coordinates
• Right-handed system
• From point of view of camera looking out into
scene:
+X right, -X left
+Y up, -Y down
+Z behind camera, -Z in front
• Positive rotations are counterclockwise around
axis of rotation
27Budditha Hettige
29. The Vertex—A Position in Space
• Each corner of the any primitive is called a
vertex. Ex: three-dimensional cube consists of
six two dimensional squares, each placed on a
separate face
29Budditha Hettige
30. Projections: Getting 3D to 2D
• Orthographic Projections
• Perspective Projections
30Budditha Hettige