Code Samples

I’ve finally released a couple of my code samples. I hope I will find the time to add some more comments, but for now the samples are provided “as is” without any warranty.

All samples are based on OpenGL, GLUT and Cg and compile on Win32 platforms using Visual C++ .NET 2005.

Christof Rezk Salama

3D Texture Slicer

This sample is a simple 3D texture slicer which uses different Cg shaders. You can easily use this example to implement and test your own shaders.

Download ZIP: 3D Texture Slicer [updated: March/20/2007]

Keyboard commands
c: mouse actions move camera
r: reset camera
l: mouse actions move light source
m: cycle through display modes
t: display/hide transfer function

GPU Slicer

Some people have reported on problems to reproduce the vertex program for box-plane intersection (Chapter 3.5.2). This example is my implementation of empty-space skipping for 3D texture slicing based on this vertex programm. (Tested on Geforce 6 hardware)

Download ZIP: GPU Slicer [updated: March/20/2007]

Keyboard commands
w/W: show/hide wireframe
s/S: show/hide octree
p/P: manually increase/decrease minimum value for octree traversal
m/M: manually increase/decrease maximum value for octree traversal
a,b,c,d,e,f: chose octree depth
t: display/hide transfer function