Updated 2014-09-06 20:18:26 by HJG

Inspired by RS famous weekend fun projects I'm trying to release a new Tcl3D demo every month.

Note: Not all of these demos are contained in the current Tcl3D distribution.

Visit the Tcl3D demo page for more information and demos.

Note, that after 5 years and 60 demos I will stop posting demos on a monthly basis. Of course Tcl3D will be developed further and new demos will appear, but on an irregular basis.

#060 February 2012 Demo edit

Here is another nice demo from NeHe's OpenGL tutorials implementing a little shooter.

The original sources are available at [1].

Tcl3D demo sources are available at [2]


#059 January 2012 Demo edit

OpenSceneGraph demo Fog showing the usage of fog in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [3].

Tcl3D demo sources are available at [4]


#058 December 2011 Demo edit

Example14 (Water Rendering) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [5].

Tcl3D demo sources are available at [6]


#057 November 2011 Demo edit

OpenSceneGraph demo SlaveCameras showing the usage of slave cameras in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [7].

Tcl3D demo sources are available at [8]


#056 October 2011 Demo edit

Example13 (Terrain Rendering) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [9].

Tcl3D demo sources are available at [10]


#055 September 2011 Demo edit

Example12 (Simple Tesselation) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [11].

Tcl3D demo sources are available at [12]


#054 August 2011 Demo edit

Example11 (Shadow Mapping) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [13].

Tcl3D demo sources are available at [14]


#053 July 2011 Demo edit

Example10 (Reflection and Refraction) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [15].

Tcl3D demo sources are available at [16]


#052 June 2011 Demo edit

Example09 (geometry shader) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [17].

Tcl3D demo sources are available at [18]


#051 May 2011 Demo edit

Example07 (environment/cube mapping) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [19].

Tcl3D demo sources are available at [20]


#050 April 2011 Demo edit

Demo of a new GLSL based noise algorithm developed by Ian McEwan at Ashima Art. The original demo was written in C by Stefan Gustavson. See this thread at the OpenGL Discussion forum for more details [21].

Tcl3D demo sources are available at [22]


#049 March 2011 Demo edit

Example06 (normal mapping) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [23].

Tcl3D demo sources are available at [24]


#048 February 2011 Demo edit

Example02a (grey filter) from Norbert Nopper's OpenGL core profile programming demos.

The original sources are available at [25].

Tcl3D demo sources are available at [26]


#047 January 2011 Demo edit

Tcl3D demo generating image sequences according to Arnold's cat map, a chaotic mapping of the pixels of an image.

Detailled description of the algorithm is available at [27].

Tcl3D demo sources are available at [28]


#046 December 2010 Demo edit

Julien Guertault's texture generation demo showing different usages of the OpenGL glTexGen function.

The original sources are available at [29].

Tcl3D demo sources are available at [30]


#045 November 2010 Demo edit

OpenSceneGraph demo Billboard showing the usage of billboards in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [31].

Tcl3D demo sources are available at [32]


#044 October 2010 Demo edit

OpenSceneGraph demo AutoTransform showing the usage of automatic transformation callbacks in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [33].

Tcl3D demo sources are available at [34]


#043 September 2010 Demo edit

This Tcl3D demo is a port of the OpenSceneGraph tutorial BasicTexturing from www.CubosLocos.com.

The original sources and explanations are available at [35].

Demo sources are available here: [36]


#042 August 2010 Demo edit

OpenSceneGraph demo UpdateCallback showing the usage of update callbacks in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [37].

Tcl3D demo sources are available at [38]


#041 July 2010 Demo edit

OpenSceneGraph demo MultiTextures showing the usage of multitexturing in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [39].

Tcl3D demo sources are available at [40]


#040 June 2010 Demo edit

Song Ho Ahn's nice ModelView matrix demo explaining and visualizing, how OpenGL transformations work. This demo needs Tcl3D version 0.4.2.

The original sources are available at [41].

Tcl3D demo sources are available at [42]

AMG: I don't understand the purpose of the gState(windowSizeChanged) variable, nor the SetViewport proc. Does it do anything useful, or is it a vestige of something else? Removing it from my copy of the program had no discernible effect.

PO: You are right. SetViewport is not necessary, because the viewports are already set with the SetViewportSub procedure. I just ported the original C program to Tcl, and as it worked, I did not analyze it further. Thanks for taking a closer look at it.

#039 May 2010 Demo edit

OpenSceneGraph demo Light showing the usage of lighting in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [43].

Tcl3D demo sources are available at [44]


#038 April 2010 Demo edit

OpenSceneGraph demo AntialiasedLines showing the usage of anti-aliased lines in OSG. It comes from the OsgHelp tutorials by Peter Wraae Marino and Michael Bach Jensen.

The original sources are available at [45].

Tcl3D demo sources are available at [46]


#037 March 2010 Demo edit

OpenSceneGraph demo Tuto11 showing the usage of billboards in OSG. It comes from the OSG tutorials by Franclin Foping.

The original sources are available at [47].

Tcl3D demo sources are available at [48]


#036 February 2010 Demo edit

OpenSceneGraph demo Picking from the OSG Quick Start Guide.

The Quick Start Guide is available at [49]. The original sources are available at [50].

Tcl3D demo sources are available at [51]


#035 January 2010 Demo edit

Happy new year with a new Tcl3D demo.

This Tcl3D demo is a port and extension of Keenan Crane's Quaternion Julia Set Ray Tracer using Cg fragment shaders.

The original sources and more explanations are available at [52]

Tcl3D demo sources are available at [53]


#034 December 2009 Demo edit

Tcl3D demo displaying molecules read from PDB (Protein Data Base) files.

PDB files are available at [54].

Tcl3D demo sources are available at [55]


#033 November 2009 Demo edit

OpenSceneGraph demo Callback from the OSG Quick Start Guide.

The Quick Start Guide is available at [56]. The original sources are available at [57].

Tcl3D demo sources are available at [58]


#032 October 2009 Demo edit

OpenSceneGraph demo Lighting from the OSG Quick Start Guide.

The Quick Start Guide is available at [59]. The original sources are available at [60].

Tcl3D demo sources are available at [61]


#031 September 2009 Demo edit

This Tcl3D demos is a port of the OpenSceneGraph tutorial PlanetEarth from www.CubosLocos.com.

The original sources and explanations are available at [62].

Demo sources are available here: [63]


#030 August 2009 Demo edit

This Tcl3D demo tests the speed of the glDrawPixels and glReadPixels OpenGL functions.

Currently the following image formats can be used for speed comparison: GL_RGB, GL_BGR, GL_RGBA, GL_BGRA.

Demo sources are available here: [64]


#029 July 2009 Demo edit

This Tcl3D demo is a port and extension of Gabriel Zachmann's Mandelbrot GLSL shader.

The original sources are available at [65], an explanation (in German) can be found in [66].

The original demo has been extended to also render the Mandelbrot set with a C and Tcl implementation for speed comparison.

Demo sources are available here: [67]

AM I could not resist the temptation, and my remark is purely esthetic, but: try the same with Julia sets, they are more or less the cousins of the Mandelbrot set, but the shapes vary greatly. Instead of changing the parameter c, you select one value and determine the number of iterations that is needed to make sure the series of a particular z0 diverges (so the iteration is over z0, not c).

#028 June 2009 Demo edit

This Tcl3D demo is a port of an OpenGL benchmark called Triangle Slammer originally written by Geoff Broadwell in Perl and ported by Bob Free to Python and SDL.

It determines performance curves for various methods of pushing triangles and quads through the OpenGL pipeline.

Single triangles (t), quads (q), triangle strips (ts) or quad strips (qs) are drawn in immediate mode, as display lists (d) or as vertex arrays (v).

Demo sources are available here: [68]


#027 May 2009 Demo edit

This Tcl3D demo is a port of an OpenGL benchmark written by Bob Free for his Perl OpenGL binding POGL.

Here are the numbers for the C and Tcl bindings:
 OpenGL Benchmark - C Binding

 OpenGL: 2.1.1 NVIDIA 100.14.09
 Vendor: NVIDIA Corporation
 Renderer: GeForce FX Go5600/AGP/SSE2

 FBO Texture Rendering FPS: 90.859658
 Teapot Shader FPS: 225.449624
 Frame overhead secs/frame: 0.000097
 OS/GLUT overhead secs/frame: 0.000031
 Overall FPS: 64.228425

 Bob Free's OpenGL Benchmark - Tcl Binding

 OpenGL  : 2.1.1 NVIDIA 100.14.09
 Vendor  : NVIDIA Corporation
 Renderer: GeForce FX Go5600/AGP/SSE2

 FBO Texture Rendering FPS: 87.4
 Teapot Shader FPS: 220.1
 Frame overhead secs/frame: 0.000285
 OS/GLUT overhead secs/frame: 0.000283
 Overall FPS: 60.4

Demo sources are available here: [69]


#026 April 2009 Demo edit

This Tcl3D demo shows the usage of a 3D texture for animation. In the upper part of the window, a quad is drawn, which shows the actual texture animation. In the lower half of the window, the 3D texture is visualized as a stack of quads. The sampling of the 3D texture is shown by a quad moving through the texture stack.

Demo sources are available here: [70]


#025 March 2009 Demo edit

2nd anniversary of Tcl3D Demo of the Month

This Tcl3D demonstration draws the six platonic solids: The tetrahedron, the hexahedron (cube), the dodecahedron, the octahedron, the icosahedron and the teapotahedron. :-)

See [71] about the history of the famous Utah teapot. This page contains an image of the original ray-traced scene by Arvo and Kirk. The image is also on the front page of Glassner's book "An Introduction to Ray Tracing".

For a mathematical description of the five platonic solids see [72].

Demo sources are available here: [73]


#024 February 2009 Demo edit

This demo shows 3 possible modes of OpenGL execution, made available with the new OpenGL wrapping based on GLEW introduced with Tcl3D version 0.4.

  • Normal mode:

Use the OpenGL functions as wrapped by SWIG. This is the fastest mode. If using an OpenGL function not available in the used driver implementation, this mode will dump core.

  • Safe mode:

In this mode every OpenGL function is checked for availability in the driver before execution. If it's not available, a message is printed out.

  • Debug mode:

This mode checks the availability of an OpenGL function like the safe mode, and additionally prints out each OpenGL function before execution.

Demo sources are available here: [74]


#023 January 2009 Demo edit

This demo is an enhanced version of the May 2007 PhotoBooth program. It adds Cg shader support, animation with time measurement and approximations of the trigonometric functions with textures and simple functions.

Demo sources are available here: [75]


#022 December 2008 Demo edit

This demo is a tool to visualize certain aspects of ray-tracing algorithms.

A description and more screenshots can be found on the Tcl3D homepage [76].

Demo sources are available here: [77]


#021 November 2008 Demo edit

This sample from Kevin Harris CodeSampler page [78] demonstrates the use of projective textures.

Demo sources are available here: [79]


#020 October 2008 Demo edit

This sample from Kevin Harris CodeSampler page [80] demonstrates the three basic types of lights available in OpenGL: directional, spot, and point lights.

Demo sources are available here: [81]


#019 September 2008 Demo edit

This sample from Kevin Harris CodeSampler page [82] demonstrates color-tracking and two-sided lighting in OpenGL.

Demo sources are available here: [83]


#018 August 2008 Demo edit

This sample from Kevin Harris CodeSampler page [84] demonstrates how to create a planar shadow under OpenGL.

Planar shadows are created by building a special matrix transform which flattens an object's geometry into a plane when rendered and is definitely one of the simplest ways of creating real-time shadows.

Demo sources are available here: [85]


#017 July 2008 Demo edit

This sample from Kevin Harris CodeSampler page [86] demonstrates how to perform alpha blending using the framebuffer.

Demo sources are available here: [87]


#016 June 2008 Demo edit

This sample from Kevin Harris CodeSampler page [88] demonstrates how to perform alpha blending using the alpha channel of a standard texture.

Demo sources are available here: [89]


#015 May 2008 Demo edit

This sample from Kevin Harris CodeSampler page [90] demonstrates how to use materials with lighting to produce different surface effects. It also shows the usage of GL_COLOR_MATERIAL to override material values.

Demo sources are available here: [91]


#014 April 2008 Demo edit

This demo originating from discussions on Wiki page Simple Chaos Theory with Tcl has been on the Wiki for some time. It is now part of the official Tcl3D demos. OpenGL stuff demonstrated in the script are GL_POINTS.

Demo sources are available here: [92]


#013 March 2008 Demo edit

This sample from Kevin Harris CodeSampler page [93] demonstrates how to orient a billboard perpendicular to the viewer's direction as defined by the model-view matrix.

Demo sources are available here: [94]


#012 February 2008 Demo edit

This sample from Kevin Harris CodeSampler page [95] demonstrates how to rotate and orient a textured quad along a particular axis for the purposes of billboarding.

Demo sources are available here: [96]


Happy new year

#011 January 2008 Demo edit

This sample from Kevin Harris CodeSampler page [97] demonstrates how to use OpenGL's new extension, ARB_occlusion_query, and nVIDIA's older extension, NV_occlusion_query to perform occlusion queries.

Demo sources are available here: [98]


#010 December 2007 Demo edit

This sample from Kevin Harris CodeSampler page [99] demonstrates how to eliminate z-fighting when rendering polygons directly on top of other polygons.

Demo sources are available here: [100]


#009 November 2007 Demo edit

This sample from Kevin Harris CodeSampler page [101] demonstrates how adjustments to OpenGL's near and far clip planes effect the view.

Look at the source to see how to use the Tcl3D supplied math functions to update the view matrix.

Demo sources are available here: [102]


#008 October 2007 Demo edit

This sample from Kevin Harris CodeSampler page [103] demonstrates how to blend two textures together with Cg using either OpenGL's native multi-texture support (using semantics) or by using Cg's special texture functions. The original demo has been extended with a little GUI to allow switching between the two call semantics at runtime.

See also the July 2007 demo for multi-texturing with OpenGL extensions.

Demo sources are available here: [104]


#007 September 2007 Demo edit

This demo from the SIGGRAPH 1996 course "Advanded Rendering" [105] shows examples of various image processing operations coded as OpenGL accumulation buffer operations. The course notes are still available [106] and interesting to read.

The file header says:
 This allows extremely fast image processing on machines with
 hardware accumulation buffers like RealityEngine or InfiniteReality.

The Times They Are A-Changin'

Demo sources are available here: [107]


#006 August 2007 Demo edit

Here is another demo from NeHe's OpenGL tutorials. Lesson 27 [108] shows how to calculate shadows with the help of the stencil buffer.

Demo sources are available here: [109]


#005 July 2007 Demo edit

This sample from Kevin Harris CodeSampler page [110] demonstrates how to use the OpenGL extensions GL_ARB_multitexture and GL_ARB_texture_env_combine in conjunction with specially encoded vertex colors to blend three textures together.

This technique is very popular in terrain rendering engines which use it to blend dramatically different textures such as rock and grass together with out creating a noticeable edge.

Demo sources are available here: [111]


#004 June 2007 Demo edit

This sample from Kevin Harris CodeSampler page [112] demonstrates the different texture addressing modes of OpenGL:

  • GL_REPEAT
  • GL_CLAMP
  • GL_MIRRORED_REPEAT_ARB
  • GL_CLAMP_TO_BORDER_ARB
  • GL_CLAMP_TO_EDGE

Demo sources are available here: [113]


#003 May 2007 Demo edit

This month is a GLSL demo with Photo Booth (see [114]) image warping effects.

The original demo was written in C by Libero Spagnolini. A description of the effect shaders and the original sources have been available at [115]. They are no longer available, but there is a snapshot at archive.org

The Tcl3D demo has been modified to allow up to 2 shader parameters to be changed interactively via a slider.

Demo sources are available here: [116]


#002 April 2007 Demo edit

The April demo is NeHe's Lesson 25 [117], a nice example of morphing. Although lots of code is done on the CPU with Tcl, it runs quite smooth.

Demo sources are available here: [118]


#001 March 2007 Demo edit

This sample from Kevin Harris CodeSampler page [119] demonstrates how to create dynamic textures through off-screen rendering with framebuffer objects.

Demo sources are available here: [120]