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.
Here is another nice demo from NeHe's OpenGL tutorials implementing a little shooter.
The original sources are available at [L1 ].
Tcl3D demo sources are available at [L2 ]
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 [L3 ].
Tcl3D demo sources are available at [L4 ]
Example14 (Water Rendering) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L5 ].
Tcl3D demo sources are available at [L6 ]
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 [L7 ].
Tcl3D demo sources are available at [L8 ]
Example13 (Terrain Rendering) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L9 ].
Tcl3D demo sources are available at [L10 ]
Example12 (Simple Tesselation) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L11 ].
Tcl3D demo sources are available at [L12 ]
Example11 (Shadow Mapping) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L13 ].
Tcl3D demo sources are available at [L14 ]
Example10 (Reflection and Refraction) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L15 ].
Tcl3D demo sources are available at [L16 ]
Example09 (geometry shader) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L17 ].
Tcl3D demo sources are available at [L18 ]
Example07 (environment/cube mapping) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L19 ].
Tcl3D demo sources are available at [L20 ]
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 [L21 ].
Tcl3D demo sources are available at [L22 ]
Example06 (normal mapping) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L23 ].
Tcl3D demo sources are available at [L24 ]
Example02a (grey filter) from Norbert Nopper's OpenGL core profile programming demos.
The original sources are available at [L25 ].
Tcl3D demo sources are available at [L26 ]
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 [L27 ].
Tcl3D demo sources are available at [L28 ]
Julien Guertault's texture generation demo showing different usages of the OpenGL glTexGen function.
The original sources are available at [L29 ].
Tcl3D demo sources are available at [L30 ]
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 [L31 ].
Tcl3D demo sources are available at [L32 ]
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 [L33 ].
Tcl3D demo sources are available at [L34 ]
This Tcl3D demo is a port of the OpenSceneGraph tutorial BasicTexturing from www.CubosLocos.com.
The original sources and explanations are available at [L35 ].
Demo sources are available here: [L36 ]
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 [L37 ].
Tcl3D demo sources are available at [L38 ]
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 [L39 ].
Tcl3D demo sources are available at [L40 ]
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 [L41 ].
Tcl3D demo sources are available at [L42 ]
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.
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 [L43 ].
Tcl3D demo sources are available at [L44 ]
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 [L45 ].
Tcl3D demo sources are available at [L46 ]
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 [L47 ].
Tcl3D demo sources are available at [L48 ]
OpenSceneGraph demo Picking from the OSG Quick Start Guide.
The Quick Start Guide is available at [L49 ]. The original sources are available at [L50 ].
Tcl3D demo sources are available at [L51 ]
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 [L52 ]
Tcl3D demo sources are available at [L53 ]
Tcl3D demo displaying molecules read from PDB (Protein Data Base) files.
PDB files are available at [L54 ].
Tcl3D demo sources are available at [L55 ]
OpenSceneGraph demo Callback from the OSG Quick Start Guide.
The Quick Start Guide is available at [L56 ]. The original sources are available at [L57 ].
Tcl3D demo sources are available at [L58 ]
OpenSceneGraph demo Lighting from the OSG Quick Start Guide.
The Quick Start Guide is available at [L59 ]. The original sources are available at [L60 ].
Tcl3D demo sources are available at [L61 ]
This Tcl3D demos is a port of the OpenSceneGraph tutorial PlanetEarth from www.CubosLocos.com.
The original sources and explanations are available at [L62 ].
Demo sources are available here: [L63 ]
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: [L64 ]
This Tcl3D demo is a port and extension of Gabriel Zachmann's Mandelbrot GLSL shader.
The original sources are available at [L65 ], an explanation (in German) can be found in [L66 ].
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: [L67 ]
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).
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: [L68 ]
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: [L69 ]
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: [L70 ]
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 [L71 ] 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 [L72 ].
Demo sources are available here: [L73 ]
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.
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.
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.
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: [L74 ]
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: [L75 ]
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 [L76 ].
Demo sources are available here: [L77 ]
This sample from Kevin Harris CodeSampler page [L78 ] demonstrates the use of projective textures.
Demo sources are available here: [L79 ]
This sample from Kevin Harris CodeSampler page [L80 ] demonstrates the three basic types of lights available in OpenGL: directional, spot, and point lights.
Demo sources are available here: [L81 ]
This sample from Kevin Harris CodeSampler page [L82 ] demonstrates color-tracking and two-sided lighting in OpenGL.
Demo sources are available here: [L83 ]
This sample from Kevin Harris CodeSampler page [L84 ] 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: [L85 ]
This sample from Kevin Harris CodeSampler page [L86 ] demonstrates how to perform alpha blending using the framebuffer.
Demo sources are available here: [L87 ]
This sample from Kevin Harris CodeSampler page [L88 ] demonstrates how to perform alpha blending using the alpha channel of a standard texture.
Demo sources are available here: [L89 ]
This sample from Kevin Harris CodeSampler page [L90 ] 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: [L91 ]
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: [L92 ]
This sample from Kevin Harris CodeSampler page [L93 ] demonstrates how to orient a billboard perpendicular to the viewer's direction as defined by the model-view matrix.
Demo sources are available here: [L94 ]
This sample from Kevin Harris CodeSampler page [L95 ] demonstrates how to rotate and orient a textured quad along a particular axis for the purposes of billboarding.
Demo sources are available here: [L96 ]
Happy new year
This sample from Kevin Harris CodeSampler page [L97 ] 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: [L98 ]
This sample from Kevin Harris CodeSampler page [L99 ] demonstrates how to eliminate z-fighting when rendering polygons directly on top of other polygons.
Demo sources are available here: [L100 ]
This sample from Kevin Harris CodeSampler page [L101 ] 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: [L102 ]
This sample from Kevin Harris CodeSampler page [L103 ] 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: [L104 ]
This demo from the SIGGRAPH 1996 course "Advanded Rendering" [L105 ] shows examples of various image processing operations coded as OpenGL accumulation buffer operations. The course notes are still available [L106 ] 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: [L107 ]
Here is another demo from NeHe's OpenGL tutorials. Lesson 27 [L108 ] shows how to calculate shadows with the help of the stencil buffer.
Demo sources are available here: [L109 ]
This sample from Kevin Harris CodeSampler page [L110 ] 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: [L111 ]
This sample from Kevin Harris CodeSampler page [L112 ] demonstrates the different texture addressing modes of OpenGL:
Demo sources are available here: [L113 ]
This month is a GLSL demo with Photo Booth (see [L114 ]) 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 [L115 ]. 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: [L116 ]
The April demo is NeHe's Lesson 25 [L117 ], 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: [L118 ]
This sample from Kevin Harris CodeSampler page [L119 ] demonstrates how to create dynamic textures through off-screen rendering with framebuffer objects.
Demo sources are available here: [L120 ]