Welcome to the demo archive

by Ingemar Ragnemalm


News may 7 2021: Added the OpenGL Utilities for Geometry Generation (GLUGG).


News april 29 2021: Updated common with some fixes in LOL and more. New version of simplefont. A number of pages with just a simple demo deleted and the content gathered under “Various”, in order to make the menu above shorter.


News april 2021: Phong bunny and friends now exists in a version that may be more valuable than the previous for those who want to use C++. The old C++ demo uses C++ for operator overloading. This one adds classes (structs with methods) and inheritance.


More NEWS february 2021: LittleObjLoader now has two more demos, “mteapot” and “tinkercar”, and is now in the main menu.


NEWS february 2021: New common and new Visual Studio version of Psychedelic Teapot. And after that, a new Mac version of MicroGlut.


NEWS august 2020: Back online after some changes due to a server move.


NEWS later april 2020: Warprotation now tested under Linux.


NEWS april 2020: A few updates to the “common” files.


NEWS january 2020: Added a “common code” page, to make the common code more visible and also a natural entry point to LittleOBJLoader ad LoadTexture.


NEWS december 2019: Updated versions of Psychedelic teapot and the quaternion demo. Both lacked proper glutInitDisplayMode, so they incorrectly relied on defaults in the Mac version.


NEWS november 2019: Uploaded, but not visible in the menu area (because I don’t really know where they should go), are two new packages, Little OBJ Loader and LoadTexture.


NEWS october 2019: An amazing four new demos: A quaternion demo, AntTweakBar for MicroGlut, and a truly tiny demo for TinyObjLoader! And on top of that, the robotarm demo that demonstrates inverse kinematics!


NEWS august 2019: A new demo added, showing how to save an OpenGL animation to a movie.


NEWS september 2017: New pages are being made for demos for TSBK03. Titles are marked TSBK03 to tell them apart. Some were already in the less elegant demo folder for TSBK03, but the compute shader demos are new. To begin with lecture 2 has been given a page with as much as six demos, and lecture 3 with four.


NEW VERSION as of march 2017! Links may be wrong, the layout may be changed… Opinions are welcome! This new version makes it easier for me to edit, easier to add pages, and it also seems to fix problems with some browsers that my old system had.


I am now - that is april 2017 - working through these demos, updating them for Linux Mint and anything else that is lagging behind. So far I have updated:

• 16 simple demos

• Collision demos

• Cube map and skybox

• Faked bump map

• GLUT Gears

• Inline texture cube

• Mipmapcube and Simplefont

• Phong bunny and friends

• Psychedelic Teapot

• Live fractal

• Procedural 2D image

• Psychedelic teapot warp

• Transpartent teapot

• Wavy wire teapot

which should be all! The “common” archive is also updated, and I am taking out any such code existing locally in old demos in order to have one current copy instead of several with varying age.


Recently added demos:

• Call me AL

• Instancing demos

• Texture splatting demos

• Phong bunny

• Phong Stanford bunny

• Simple shadow

• Planet system

• Textured glossy sphere

• Multitextured bunny

• “Bill”, the billboarding demo

• Warprotation (a demo of glutWarpPointer)



Most of the following demos are 100% written by myself. Many are conversions of my old demos for OpenGL 2.1, while others are totally new. Demos that are substantially based on code by others should be properly documented as such. (That is my intention. I can make mistakes but I think I usually do this right.)


These examples were developed for my courses, and are intended to complement my course book "Polygons Feel No Pain". I plan to extend these pages with demos for volume 2, So How Can You Make Them Scream?, too, but at this time the focus is on volume 1.


All code has been tested on MacOSX, Linux (CentOS and Mint). There are also a few demos that have been adapted for Visual Studio under MS Windows. There are many other development systems, but I can't support all, and if they are good, it should be easy to make it work under them.


Reusable code

These files are needed for ALL demos! (Well, at least some parts are used over and over.)

This package includes:

MicroGlut, a single file GLUT replacement with the essentials and no old OpenGL dependencies, available for Linux, OSX and Windows.

VectorUtils3, a fairly capable vector/matrix package.

loadobj, a model loader that loads a subset of the Wavefront OBJ format. (Parts written by Mikael Kalms.)

GL_Utilities, shader loader and more.

LoadTGA, loader for TGA images (simple lab-friendly image format)

LitttleObjLoader, a model loader that loads most models in the Wavefront OBJ format. (Parts written by Mikael Kalms.) Replaces “loadobj” which it is based on.


Note: Most demos are still written for loadobj. They will be updated ASAP. The changes in the demo code will be minor.


Download:


common.tar.xz (updated 2021-02-19)


This page is maintained by Ingemar Ragnemalm.