A Steroid

Asteroids™ doped by

A step by step didactic example of portable OpenGL game programming

Visual Computing Group
Paolo Cignoni
cignoni@isti.cnr.it

Latest Version here

In this page you will find the description of the development of a simple game project whose purpose is mainly didactic: explaining the basics of interactive 3d programming with opengl. This game has been developed as a six lesson exercise for the Computer Graphics course IUF of the Dipartimento di Informatica at the University of Pisa.

A Steroid runs under Windows and Linux, it is developed using glut 3.7 (and therefore it requires requires glutdlls37.zip). Various public libraries and utilities were used to develop it. You can find them in the Resources

The development of the game has followed various step, that are supposed to present opengl features of increasing complexity (from wireframe to texture mapping). At the end of each step, some exercises of various complexity are presented. Versions are numbered according these steps, version numbers ending with an 's' present the solution to the exercises proposed in previous step.

Each version is documented with Doc++ a free documentation system for C, C++ and Java generating both TeX and HTML output. The documentation is extracted directly from the C/C++ header/source comments. Detailed comments on the various aspects of each version, what features are added and how they were implemented, are described in the hmtl documentation. I hope that this can make the source a viable tool for teaching opengl.

Any suggestion on how to improve documentation and the game is welcome and can be addressed to cignoni@isti.cnr.it.

Game Design

The philosophy of the game is still the original Atari arcade Asteroids™: shoot down the asteroids. The game play itself is 2D (you drive the spaceship on a plane), but all the objects (asteroids, ship and so on) of the game are 3D modelled and rendered with opengl. Some add-ons and different class of asteroid and ships will be added to improve the game longevity.

Version History

 

V0.1

Main Features:
First working release, Very dull graphics (space ship is a triangle and asteroids are squares). The base classes of the game objects are defined. Basic phisics of the game working (inertial ship movement, accelleration etc.).

Opengl and Computer Graphics Topics:
Transformations and wireframe drawing

Download

V0.1s

Main Features:
Version with solutions to the proposed exercises:

  • fractal asteroids
  • subclassing ship class for making a better ship

Opengl and Computer Graphics Topics:

Download

V0.2

Main Features:
Asteroids and the ship now have a 3d shape

Opengl and Computer Graphics Topics:
Basic notions on shading, Mesh class loading a raw mesh file and rendering it

Download

V0.2s

Main Features:
3D release, Fractal smoothed Asteroids

Opengl and Computer Graphics Topics:
Smooth shading, per-vertex normal interpolation.
Fractal generation of an asteroid

Download

V0.3

Main Features:
Collision and Explosion Release, Asteroids now destroy the ship and can be destroyed by bullets

Opengl and Computer Graphics Topics:
Collision Detection and transparency (for the explosions)

Download

V0.3s

Main Features:
Lighted Explosion release, Explosion lighten the nearest asteroids

Opengl and Computer Graphics Topics:
Lights and their properties

Download

V0.4

Main Features:
First Intro and rendering optimizations

Opengl and Computer Graphics Topics:
Display Lists and vertex arrays

Download

V0.4s

Main Features:
Better Intro

Opengl and Computer Graphics Topics:
Planning an animated 3d scene and implementing it
View Frustum Clipping

Download

V0.5

Main Features:
Texture and Sound
(music courtesy of F. Del Priore)

Opengl and Computer Graphics Topics:
Texture Mapping

Download

V0.5s

Main Features:
Textured Asteroids

Opengl and Computer Graphics Topics:
Texture Mapping, sharing texture objects

Download

V0.6

Main Features:
Triple Fire Add-on , almost a complete game....

Opengl and Computer Graphics Topics:
Level of details

Download

Resources

In the develoment of A Steroid the following libraries were used:

Last modified on 16/3/2000