Tutorials 

Please note:
This page was created in 2000 and updated for a few years but does no longer provide the latest content. You can learn about the fundamentals of OpenGL here but please keep in mind that 3d graphics is a rapidly improving field.
introduction

transformation, animation
camera 1

lighting, depth testing

vertex arrays

display lists

textures

fountain 1

particles

camera2

Sample Code  
Fountain + Simulated Water!

flag in the wind

water simulation



Also visit my Tokamk Physics Engine Tutorials using OpenGl.

Links

Books and other resources

 

Quick download: All tutorial descriptions

 

Note: For all sample code using GLUT you have to download GLUT:

http://www.xmission.com/%7enate/glut.html

Tutorials
Introduction to OpenGL

Difficulties:
- Initialization of OpenGL
- Drawing a triangle

Uses:
- GLUT

Downloads:
Complete tutorial (description, Win32-exe and VC++ Project) (20kb)
Source (1kb)
Description
 

intro.gif (7749 Byte)

Transformations Part1 and animation

Difficulties:
- Applying several transformations to an object
- Getting a smooth animation (double buffering)

Uses:
- GLUT
- Double buffering

Downloads:
Complete tutorial (19kb)
Source (1kb)
Description
 
transani.gif (5036 Byte)
Transformations Part2

Difficulties:
- Combining several transformations
- Using the matrix stack

Uses:
- GLUT
- Double buffering

Downloads:
Complete tutorial (18kb)
Source (1kb)
Description
 
solar.gif (19857 Byte)
Using a camera and simple user input

Difficulties:
- Writing a class for simulating a camera in OpenGL
- Getting some user input with GLUT

Uses:
- GLUT
- Double buffering
- User input
- Camera (wow!)

Downloads:
Note: Also download the advanced camera

Complete tutorial (36kb)
Source (3kb)
Description
 
camera.gif (22083 Byte)
Depth Testing and Lighting

Difficulties:
- Enabling depth testing
- Enabling lighting
- Specifying the lights

Uses:
- GLUT
- Double buffering
- Depth buffer
- User input
- Camera

Downloads:
Complete tutorial (37kb)
Source (4kb)
Description
 
lightdepth.gif (9957 Byte)
Vertex Arrays

Difficulties:
- Computing the vertices on a sphere
- Using vertex arrays (vertex and color array)

Uses:
- GLUT
- Double buffering
- Vertex arrays
- User input

Downloads:
Complete tutorial (25kb)
Source (3kb)
Description
 
vertexarray.gif (19604 Byte) 
Castle example using Display lists

Difficulties:
- Creating display lists
- Computing the walls and the towers

Uses:
- GLUT
- Double buffering
- Depthbuffer
- User Input
- Camera
- Lighting
- Display Lists

Downloads:
Complete tutorial (38kb)
Source (5kb)
Description
 
castle.gif (3563 Byte)
Texture Mapping and backface culling

Difficulties:
- Enabling BfC
- Enabling texture mapping
- Setting the texture environment parameters
- Loading textures from Windows-Bitmaps
- Creating Mipmaps
- Specifying the texture coordinates

Uses:
- GLUT
- Double buffering
- Depthbuffer
- User Input
- Camera
- Texture mapping (texture objects)
- Backface culling

Downloads:
Complete tutorial (131kb)
Source and textures (94kb)
main.cpp using DevIL instead of glAux (6kb, thanks to Alessandra Sciutti)
Description
 
textures.gif (28515 Byte)
Fountain simulation

Difficulties:
- Physical simulation of a drop
- Calculation of the surrounding stone
- Enable blending

Uses:
- GLUT
- Double buffering
- Depth buffer
- Moving the viewpoint
- User input
- Vertex arrays
- Display Lists
- Texture mapping
- Blending, antialiasing

See also:
Foutain with simulated water

Download:
Complete tutorial (128kb)
Source and texture (106kb)
Description
 
fountain.gif (10407 Byte)
CodeColony Particle Engine

Difficulties:
- Creating particles with partly random properties
- Rendering translucent, textured polygons
- Billboarding
- Combination of translucent and opaque polygons

Uses:
- GLUT
- Double buffering
- Depth buffer
- Moving the viewpoint
- User input
- Texture mapping
- Blending
Download:
Complete tutorial (330kb)
Source, textures and description (291kb)
Description
 
particles.gif
Advanced camera

Difficulties:
- Rotation around all three axis
- strafe, move forward, move in the up direction

See also:
Looking at the camera

Download:
Complete tutorial (53kb)
Source and Executable (36kb)
Description
 
Coming soon....  
 


Sample Code
Fountain + simulated water!

This is a combination of my fountain and my swimming pool.

Therefore I created a Pool-Class and a Fountain-Class, which can easily be combined.

The fountain has also become more flexible - look at the screenshots on the right and read the documentation to see how to create such fountains.

Download:
Complete sample (source code + textures + executables + readme) (490kb)

fountainwater.jpg
More screenshots:

"Flags in the wind" - physical flag simulation

This sample code demonstrates flags in the wind.

Possible improvements: more exact integration methods for less elasticity and "collision detection"

Download:
Complete sample (source code + textures + executables) (175kb)

flag.jpg

"Swimming Pool" - Water/Wave simulation

This sample code demonstrates a MOVING water surface. There will be no explanation.

Download:
Complete sample (source code + executables + help file) (44kb)
Source code + help file (10kb)
Some information

pool.jpg

Looking at the camera
This sample code shows the behavior of the three orientation vectors of the advanced camera

Download:

Source and executable
 
Books and other resources

If you seriously want to learn OpenGL programming, you really have to read the Official Guide to Learning OpenGL - also called the RedBook. It is quite easy to read and contains nearly all information you need. It is online available here.

For more books have a look at http://www.opengl.org/Documentation/Books.html.

For OpenGL-related web sites click here.

For Dephi-developers there is a book by Jon Q Jacobs:
http://home1.gte.net/jqjacobs/index.htm

Back to Main
visitors since June, 18th, 2000