SIRDS Generator
Single Image Random Dot Stereograms are really amazing.  I can remember as a child, staring for ages at these pictures in shops trying to see the pictures in 3D.  With practise, I was able to see them quite easily.  Now, I can see the images in about 3 seconds so practising is definately worth the effort.  The utility presented here not only generates the pictures but also allows the background patterns to be generated easily.

  The background is critical to the working of these pictures as well as the overall appearance.  The background must be random in appearance to prevent "phantom" points from appearing.  Phantom points are caused when two unrelated pixels match up when the eyes are crossed causing the 3D illusion to create dots which shouldn't be there.  It is possible to take an image and tile it across and down the screen and this creates some very interresting results, these work well because the large number of colors in a tiled image minimizes the phantom dots problems.  The background generator allows 15 colors to be selected by the user so that the colors can go well with the theme of the picture.  3 checkboxes allow different algorithms to be mixed and matched to give the best results.  A trackbar is provided for choosing the "courseness" of the fractal algorithm and another 11 are provided for adjusting the randomness of the picture.  Because of the small number of colors, repetition can be quite high and the chance of phantom pixels is high.  The generator is able to eliminate these repetitions by the algorithms it uses and it is possible to create good  backgrounds very easily.  The best way to understand these settings is to try them out and see what effect they have.  These settings can be loaded and saved along with thumbnails to allow backgrounds to be selected from previously used formulas.  These files are saved in the directory which the executable is placed in. Tiled images can also be easily loaded aswell.

The main image must be in greyscale with white being closest to the observer and black being furthest from the observer. I have had reasonable success by using my OpenGL compiler (VisionGL) to create images using all white and using "Black Fog" to make distant surfaces fade away.  Because of the algorithm used for fog in opengl it isn't a perfect method but is easy to play with.  3D ray tracing software will create the best images though.  If you just want to have a play, there is a very basic editor included which allows shades of grey to be easily selected and basic shapes to be drawn.  There is a button for dithering aswell but it didn't work the way I intended it to.  The effect of this dithering pattern is quite interresting so I left it in.  Save your work before you use it though as the effect may ruin your work.  It was intended that images be created outside of the utility so the editor is nothing more than a toy (although it is usefull for touch-up work).  Have a play and you'll see that there is nothing complicated about it.

The Stereogram generator is the guts of the system and applies a series of formula's and hidden surface removal processes to the main and background images to generate the final image.  There are 3 parameters which can be changed: Eye Separation, Observer Distance and Distance to Screen.  These relate to the formula used to generate the picture and can be left as-is.  Experimentation with these will allow the depth of the 3D effect to be changed and can help bring out finer details.  As with all of my programs, please let me know if there are any bugs and any PayPal donations will be gratefully accepted.  In the future, I may also add an OpenGL editor to it.

The Zip file contains the program and some background files as well as an example base picture of a simple landscape.  Copy all the files to the same folder and away you go.  The ".BKG" files are all background files which hold numerical values used to create a background.  Each bkg file has a matching bmp file holding a preview of what the background looks like and these files must be kept together.

Keep an eye out for VisionGL, I may post it on my site soon.  It allows OpenGL scripts to be written, compiled and displayed from a user friendly environment.  I have created a complete model of my house which I can 'walk' through as a test script.
Theory of SIRDS
Download SIRDS Generator
Return to C++ Page