Welcome to the demo archive

by Ingemar Ragnemalm


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. All use of loadobj is 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.

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.


See the “common” page.


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.tar.gz (updated 2022-01-13)

This page is maintained by Ingemar Ragnemalm.