Welcome to the demo archive

by Ingemar Ragnemalm


Welcome to the Polygons Feel No Pain demo archive! Here I collect various demos that I use in my courses.


It should be noted that all my code is based on a collection of  “Common” code. You find that in the packages page.


News 22 april 2024: C++ version of multiple demos, plus added the demo “Proportional teapot” to the “16 simple demos” to show how you can keep your view proportional when the window changes size.


The following demos are now in C++ versions:


16 simple demos (including Proportional teapot!)

Transparent teapot

Fake bumped cube

Psychedelic teapot

Multitextured bunny

Phong bunny and friends

Textured glossy sphere

Live fractal

Rotation animation with instancing

Billboard instancing

Billboard instancing with instanced arrays

Instancing bunny

Mipmapcube and Simplefont

Simple shadow

GLUT Gears

Procedural 2D image

Inline texture cube

Phong Stanford bunny

Planet system

BetterFrustumDemo

Flat bunnies (3 demos)

Light attenuation

Shadow cubes

Simple shadow plus

Two lights

Warprotation


Note: Why are there old versions of everything? Because I do make mistakes, and if one link is dead or a demo is broken, the older version of the demo is still available. I do clean up some old versions but security comes first.


Why havn’t I run all in Linux, even with makefiles? Time.


News april 2024: C++ version of the collision demos.


News april 2024: C++ version of the portal demos.


News march 2024: Improved the contrast of the page.


News august-september 2023: Uploaded the Beachball Physics demos and added a page for them. Updated 2023-09-18.


News january 2023: Uploaded 8 demos from TSBK07/TSBK11, including a new frustum culling demo and the “flat bunnies” picking demos.

News january 2023: Added the spaceship demo from lecture 2, both C and C++ versions. It is in “Various”.


News april 2022: Added a new version of the billboard instancing demo, using instance arrays to pass data per instance.


NNews march 2022: Removed the “packages” from the menu. These pages are now in the “packages archive”.


News march 2022: New updates: All TSBK03-demos, most “Various” and most other demos (splatting demos, instancing etc). I think all download links work.


News february 2022: This page is becoming too big, so “packages”, reusable code (Common, Glugg, SimpleGUI, Call me Al...), are migrated to a new page, the “Packages archive”. All reusable code will go there. For the moment, they also remain here but that is a temporary condition.


News february 2022: SimpleGUI is released, and a few days later updated to version 0.1. New Mac version of MicroGlut (to hopefully fix the problems I had on recent lectures). New version of GLUGG.


News january 2022: common is updated, complete with the new version for Windows, now written for CodeBlocks and other MinGW based platforms.


Also, several demos are updated (but not all). All use of loadobj in these demos are replaced by LittleOBJLoader. Some corrections that make some demos run better under Linux. Code cleanup.


16 simple GL3 examples: Cleaned up, fixes.

collision demo: Similar fixes plus two variations of demo 2 that take advantage of LittleOBJLoader to load more geometry from one file.

cubemap and skybox demo

Phong bunny and friends extended CPP

Phong bunny and friends

Phong bunny

Psychedelic teapot: Update of the standard version, added a separate archive with a CodeBlocks project for Windows.

SimpleFont: Now tested under Mac, Linux and Windows. API simplified even further! CodeBlocks project.

Transparent teapot


and this one I think is new:


2d image Mandelbrot


It has no page yet. I guess “various” will be suitable.


News late december 2021: GLUGG 1.1 is now uploaded, with a number of new features.


News december 2021: The new MicroGlut for Windows has now been running in three new labs for TNM084 and has worked very well so far! I switched to Codeblocks for practical reasons (it was installed in the lab), and that worked just fine. The code on this page is currently not fully up-to-date since it needs to be syncronized and tested on Linux and Mac. The new versions are currently at the TNM084 page, including the latest version of GLUGG.


News may 24 2021: MicroGlut for Windows has a major overhaul coming up. Visual Studio caused so much problems, but now MicroGlut works just fine under MinGW/DevC++, so I am switching to that. (Using Visual Studio Code should work too - which is not the same as Visual Studio.) No more printf problems, fewer special cases in my code, no extra Windows code outside MicroGlut. PS: This was not correctly synched into the archive. I will fix that when I can. Until then, I can mail you the package as needed.


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/modernization with the essentials and no old OpenGL dependencies, available for Linux, OSX and Windows.

VectorUtils4, 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.


See the “common” page in the Packages archive.


Note: Some demos are still written for loadobj. A fair number was updated to LittleOBJLoader in 2022 including one new demo that takes advantage of the new features.


Download:


common.zip (updated 2024-04)

common.tar.xz (updated 2022-08-29)

common.tar.gz (updated 2022-08-29)

common-jan22.tar.gz (updated 2022-01-13)

This page is maintained by Ingemar Ragnemalm.