by W.A. Steer PhD
About...
My stereogram software was still in a phase of rapid development when I wrote the document now published in the book "Stereogram Programming Techniques". In rigorous testing shortly after the script was sent to the authors, I discovered a few previously unnoticed bugs in the programs, and also a couple of transcription errors. Unfortuanately I was not given the opportunity to proof-read the text as finally formatted for the book and most of my corrections did not make it to the printed page.
![]() |
"Stereogram Programming Techniques"
by Christopher D. Watkins and Vincent P. Mallette (Charles River Media, Inc.), 1996 ISBN: 1-886801-00-2 See the Charles River Media page for more information about the book. |
The ammendments below should be made to chapter 13 of the book.
but should read:
Sorry, with hindsight my original could have been more clear.
if (vis==TRUE) lookL[right]=left; lookR[left]=right; // make linkThe need for braces around the conditional code was overlooked in the original program, in each case the line should have read:
if (vis==TRUE) { lookL[right]=left; lookR[left]=right; } // make link
PatPos[x]=PatPos[x-1]+1; PatPosY[x]=PatPos[x-1];The upper line should have a modulo-patwidth, and the lower one should refer to PatPosY on both sides of the assignment. They should read:
PatPos[x]=(PatPos[x-1]+1) % patwidth; PatPosY[x]=PatPosY[x-1];as in the full program listing.
for (x=s-1; x>=0; x--)the -- was inadvertantly converted to its "typographical equivalent" (an em-dash) by my wordprocessor.
tpatY=(patY+((s-lastlinked)/(vpatwidth/2))*(ydpi/16)) % patternbmp->GetHeight();To prevent artifacts arising when there is a depth step in the middle pattern stripe (this relates to the from-the-centre-outwards method), it is necessary to further y-shift pattern which is inserted when working leftwards by putting a +2 in this line. It should read:
tpatY=(patY+((s-lastlinked)/(vpatwidth/2)+2)*(ydpi/16)) % patternbmp->GetHeight();
for (x=0; x<vwidth; x++) { featureZ=oversam*<depth of image at (x/oversam,y)> sep=(int)(((long)veyeSep*featureZ)/(featureZ+vobsDist)); left=x-sep/2; right=left+sep;
for (x=0; x<vwidth; x++) { if ((x % oversam)==0) // SPEEDUP for oversampled pictures { featureZ=oversam*<depth of image at (x/oversam,y)> sep=(int)(((long)veyeSep*featureZ)/(featureZ+vobsDist)); } left=x-sep/2; right=left+sep;
©1995-2002 William Andrew Steer