home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / SIRD_FAQ.TXT < prev    next >
Internet Message Format  |  1996-01-04  |  31KB

  1. From kth.se!sunic!EU.net!howland.reston.ans.net!usenet.ins.cwru.edu!eff!news.kei.com!uhog.mit.edu!news.mtholyoke.edu!news.byu.edu!news.provo.novell.com!next18.Test.NPD.Provo.Novell.COM!thale Sat Dec 25 15:06:21 MET 1993
  2. Article: 4196 of alt.3d
  3. Newsgroups: alt.3d
  4. Path: kth.se!sunic!EU.net!howland.reston.ans.net!usenet.ins.cwru.edu!eff!news.kei.com!uhog.mit.edu!news.mtholyoke.edu!news.byu.edu!news.provo.novell.com!next18.Test.NPD.Provo.Novell.COM!thale
  5. From: thale@novell.com (Todd D. Hale)
  6. Subject: SIRDS FAQ (needs an FTP home)
  7. Message-ID: <thale.109.755537488@novell.com>
  8. Lines: 745
  9. Sender: usenet@Provo.Novell.COM (USENET News)
  10. Nntp-Posting-Host: next18.test.npd.provo.novell.com
  11. Organization: Novell, Inc., Provo, UT, USA
  12. Date: Fri, 10 Dec 1993 15:31:29 GMT
  13.  
  14. The following is a smattering of info I've collected about SIRDS.  It is not 
  15. too well organized, nor complete, but it answers a lot of FAQs out there.  
  16. Please submit any updates/changes to me at thale@novell.com.
  17.  
  18. The following sections are covered herein:
  19.  
  20.    SIRDS terminology
  21.    SIRDS FTP Sites
  22.    Sample TEXT Stereograms
  23.    Commercial SIRDS Software    <-- Need more info
  24.    HOW STEREOGRAMS WORK         <-- By popular demand!
  25.    Stereogram Algorithm         <-- Also new (and rough)
  26.    SIRDS Publications
  27.    C Code to Generate SIRTS
  28.    Hope for the Hopeless
  29.    Commercial SIRDS Posters
  30.  
  31.  
  32.  
  33. -----------------------------------------------------------------------
  34. ----- SIRDS TERMINOLOGY -----------------------------------------------
  35. -----------------------------------------------------------------------
  36.  
  37. SIRDS       Single Image Random Dot Stereogram
  38. SIRD        Single Image Random Dot (not much to view in a dot; used by 
  39.             newbies)
  40. SIRTS       Single Image Random TEXT Stereogram, also called ascii 
  41.             stereograms
  42. Stereogram  general, simplified term for SIRDS and SIRTS and even
  43.             stereo-pairs (occasionally)
  44. Autostereogram, RDS, Auto RDS
  45.             equivalent to a SIRDS
  46. RLS         Random Line stereograms, instructional in learning stereogram
  47.             concepts (see Slinker and Burton publication)
  48.  
  49. Wall-eyed viewing   Viewing stereograms by focusing past the actual image
  50. Cross-eyed viewing  Viewing stereograms by focusing in front of the image
  51. Focus to infinity   Forcing your eyes' lines of sight into parallel, NOT
  52.                     necessary for wall-eyeing SIRDS!
  53.  
  54.  
  55. -----------------------------------------------------------------------
  56. ----- SIRDS FTP SITES -------------------------------------------------
  57. -----------------------------------------------------------------------
  58.  
  59. Submissions from E.Thompson@newcastle.ac.uk, kbaum@novell.com, ...:
  60.  
  61. ftp.uwp.edu (131.210.1.4)
  62.   /pub/msdos/picture.viewers/rdsdraw.zip
  63.     EXCELLENT SIRDS painting/generating program.  CHECK IT OUT!
  64. oak.oakland.edu (these are also on wuarchive, but oak is faster)
  65.   /pub/msdos/graphics/mindim20.zip
  66.     Several SIRDS (~32) in an RLE format with versatile viewer.  GET IT!
  67.   /pub/msdos/graphics/sirdvu11.zip
  68.     Nice PCX to SIRDS (color to random dots) converter.
  69.   /pub/msdos/graphics/perspect.zip
  70.     Simple SIRDS paint/view program
  71. wuarchive.wustl.edu (128.252.135.4) 
  72.   /pub/MSDOS_UPLOADS/demos/sirdsani.zip
  73.     Lets you load a 3d object, position it, then generates an animated rotation
  74.     within stereograms.
  75.   /pub/xpgs/xpgs.?.?
  76.     Xwindows stereogram utilities; generator, viewer, mindim rle viewer...
  77.   /pub/MSDOS_UPLOADS/graphics/dynamic.exe
  78.     Animated SIRDS (page flipping)
  79.   /graphics/graphics/mirrors/sugrfx.acs.syr.edu/3d/randot/3drandot.zoo
  80.     Converts color GIF to SIRDS on screen
  81. sunsite.unc.edu
  82.   /pub/academic/computer-science/virtual-reality/3d/
  83.     alt.3d.Z        Older archive of the alt.3d newgroups  
  84.     randot          Various programs to make random dot stereograms 
  85.     red_blue        Graphic files for viewing with Red/Blue glasses
  86.     stereograms     Graphic and Text files of steroegrams 
  87. ftp.cs.waikato.ac.nz
  88.   /pub/papers/???.tar.Z
  89.     Research paper describing sirds, with several improvements
  90. (archive??)
  91.   shimmer.exe
  92.     Flips through several SIRDS of the same image to create a shimmering effect
  93.     (related to above research paper)
  94. gwaihir.dd.chalmers.se
  95.   pub/een/SIS/*.tif
  96.     Sharp SIRDS in TIFF graphic format.
  97.  
  98.  
  99. -----------------------------------------------------------------------
  100. ----- SAMPLE TEXT Stereograms (Not random) ----------------------------
  101. -----------------------------------------------------------------------
  102.  
  103. From: dthomas@bbx.basis.com (Dave Thomas)
  104.                                                                         
  105.                             O   O
  106. n   n   n   n   n   n   n   n   n   n   n   n   n   n   n  n
  107. f    f    f    f    f    f    f    f    f    f    f    f   f
  108. e   e   e   e   e   e   e   e   e   e   e   e   e   e   e  e
  109. a    a    a    a    a    a    a    a    a    a    a    a   a
  110. a   a   a   a   a   a   a   a   a   a   a   a   a   a   a  a
  111. r    r    r    r    r    r    r    r    r    r    r    r   r
  112. r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  113.         
  114.  
  115.  
  116. g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g  g
  117. r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r
  118.  e    e    e    e    e    e    e    e    e    e    e    e    e    e    e
  119. a     a     a     a     a     a     a     a     a     a     a     a     a
  120.  t      t      t      t      t      t      t      t      t      t      t
  121. <<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>>
  122.  d      d      d      d      d      d      d      d      d      d      d
  123. e     e     e     e     e     e     e     e     e     e     e     e     e
  124.  p    p    p    p    p    p    p    p    p    p    p    p    p    p    p
  125. t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t
  126. h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h  h
  127.  
  128.  
  129. One more from ... well ... YOU figure it out!
  130.  
  131. _-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~
  132. !   Adam      Adam      Adam      Adam      Adam      Adam   ! "Lawn       !
  133. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg!   service!" !
  134. !   Adam      Adam      Adam      Adam      Adam      Adam   !       -Stup !
  135. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg!             !
  136. !   Adam      Adam      Adam      Adam      Adam      Adam   !  atspragg@  !
  137. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg! ucdavis.edu !
  138. !   Adam      Adam      Adam      Adam      Adam      Adam   !   GO AGS!   !
  139. _-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~
  140.  
  141.  
  142.  
  143. -----------------------------------------------------------------------
  144. ----- COMMERCIAL SIRDS SOFTWARE ---------------------------------------
  145. -----------------------------------------------------------------------
  146.  
  147. STW_DEMO.EXE: the full package will allow RDS creation
  148.    Approx 40$
  149.    N.E.Thing Enterprises
  150.    P.O. Box 1827
  151.    Cambridge, MA 02139
  152.  
  153. Stareo-3D ??
  154.  
  155. I know there are more!  SEND MORE INFO!
  156.  
  157.  
  158. -----------------------------------------------------------------------
  159. ----- How Stereograms Work --------------------------------------------
  160. -----------------------------------------------------------------------
  161.  
  162. Let's start with a simple repeating pattern.  First we'll examine viewing
  163. stereograms wall-eyed (focusing beyond the picture).
  164.  
  165.               Adam
  166. Adam                       Adam          <-- PERCEIVED IMAGE (3D)
  167.   \ 
  168.    \ \
  169.     \   \
  170.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  171.      \       \
  172.       \         \                        <-- LINES OF SIGHT FROM EACH EYE
  173.        \           \
  174.        (*)           (*)                 <-- EYES
  175.  
  176. As shown in the above graphic, the lines of sight go through different
  177. (but identical) words.  The eyes must be directed to just the right level
  178. behind the picture to get the two "Adams" to line up.  When they do line 
  179. up, a single "Adam" appears at the level shown behind the picture.  
  180.  
  181. This is why it is easiest for some people to look at stereograms behind
  182. glass.  You simply look at your reflection, which appears to be behind
  183. the glass at about the same level as the 3d stereogram image.  More on
  184. this later.
  185.  
  186. So, why is the second "Adam" in the above image "deeper" than the other
  187. two?  Since the next two "Adams" that line up are FARTHER apart than the
  188. first two, your eyes must diverge a little more to get them to line up.  
  189. away.
  190. This causes the next "Adam" to appear deeper in the image.
  191.  
  192.               Adam
  193. Adam           |           Adam          <-- PERCEIVED IMAGE (3D)
  194.               / \
  195.              /   \
  196.             /     \
  197.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  198.            /       \
  199.           /         \                    <-- LINES OF SIGHT FROM EACH EYE
  200.          /           \
  201.        (*)           (*)                 <-- EYES
  202.  
  203. The above graphic was crammed into 10 lines of text.  If we moved the 
  204. eyes back (to a more realistic distance), the whole 3d image would 
  205. appear deeper, and not so spread out.
  206.  
  207. Cross-eyed viewing follows the same principles, but brings the focal point
  208. up front of the picture and inverts the image.  I'll use the same eyes and
  209. picture, but move the eyes back for room to illustrate.
  210.  
  211.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  212.        \   |
  213.          \|
  214.          Adam                            <-- PERCEIVED IMAGE (3D)
  215.          |   \
  216.          |     \
  217.         |         \                      <-- LINES OF SIGHT FROM EACH EYE
  218.         |           \
  219.        (*)           (*)                 <-- EYES
  220.  
  221. Now for the inverse part.  Since the next two "Adams" are farther apart,
  222. you must cross your eyes MORE (converge instead of diverge your eyes) to
  223. get the "Adams" to overlap.  This causes the next "Adam" in the image to
  224. appear closer than the first one.
  225.  
  226.     Adam  Adam    Adam  Adam             <-- ACTUAL PICTURE (Flat, 2D)
  227.            \      /
  228.             \    /
  229.          Adam\ / Adam                    <-- PERCEIVED IMAGE (3D)
  230.              Adam
  231.              /  \
  232.            /      \                      <-- LINES OF SIGHT FROM EACH EYE
  233.          /          \
  234.        (*)           (*)                 <-- EYES
  235.  
  236. Whew.  Ascii graphics are a bit too tight to be very technical.  By the
  237. way, each letter (or pixel) in the 3D image comes from two letters in
  238. the picture.  Stereograms have blurry edges (right and left edges) 
  239. because the line of sight from the one eye passes through the picture, 
  240. but the line of sight from the other eye is off the picture.  Examine
  241. the wall-eyed example below.
  242.  
  243.                      Adam
  244.        Adam                       Adam     <-- PERCEIVED IMAGE (3D)
  245. \               
  246.   \ \
  247.     \   \
  248.        \   Adam  Adam   Adam  Adam         <-- ACTUAL PICTURE (Flat, 2D)
  249.          \     \
  250.             \       \                      <-- LINES OF SIGHT
  251.               \           \          
  252.               (*)           (*)            <-- EYES
  253.  
  254. Here, the line of sight for the right eye goes through first "Adam" 
  255. in the picture, and the line of sight for the left eye is off the
  256. picture.  (Everything to the left of the first "Adam" in the IMAGE 
  257. is blurry.)
  258.  
  259.  
  260. HOW TO GENERATE STEREOGRAMS
  261.  
  262. Random stereograms work the same way; they simple repeat random text or
  263. pixels, instead of words like the "Adam" used above.  Below, the pattern, 
  264. "ASDFGHJK", is repeated four times in each line.  (I duplicated it for
  265. easier viewing.)
  266.  
  267.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  268.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  269.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  270.  
  271. As you might guess, the image consists of THREE repetitions of the 
  272. pattern, set back behind the picture (wall-eyed).  To add some varying
  273. depth to the image, we can simple add a space in the middle; or better,
  274. we'll add a different letter, the letter Q.  I've also dropped the K
  275. off the end to keep it suitable for framing. :-)
  276.  
  277.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  278.          ASDFGHJKASDFGHJKASQDFGHJKASDFGHJ
  279.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  280.  
  281. Adding the Q has the same effect as adding the space between "Adams"
  282. in the previous example.  Here it is again for comparison.
  283.  
  284.          Adam Adam Adam Adam Adam Adam
  285.          Adam Adam Adam  Adam Adam Ada
  286.          Adam Adam Adam Adam Adam Adam
  287.  
  288. These two stereograms demonstrate going down a level (deeper, for wall-
  289. eyed viewers) by adding a new letter where you want to go down.  The
  290. image returns back to the original level because the added letter was
  291. not repeated down the line; it was essentially deleted again.  Hence,
  292. deleting a letter causes the image to come forward one level.  Lets 
  293. look at this by deleting a letter before adding any.
  294.  
  295.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  296.          ASDFGHJKASDFGJKASDFGHJKASDFGHJKA
  297.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  298.  
  299. I deleted an H from the middle row, and added an A on the end to make
  300. it flush again.  This causes the image to come up a level where the H
  301. was deleted, then go back down where the H returns to the pattern.
  302.  
  303. To fully control the ups and downs of stereogram generation, you simply
  304. keep track of what's repeating and add and delete letters when needed.
  305. For example, start with the pattern ASDFGHJK.  If the input for the 3D
  306. stereogram image is 00000000000011111222221111111110000, where the 
  307. numbers represent the levels of the 3D image, you simply delete a letter
  308. from the pattern when you go up a level (0 to 1, or 1 to 2), and add a
  309. letter to the pattern when you go down a level (2 to 1, or 1 to 0).
  310.  
  311. If you want to go up multiple levels, e.g., from level 1 to 3, delete
  312. 2 letters from your pattern.  Adding two letters to the pattern likewise
  313. causes a two-level drop in the image.
  314.  
  315. Start each line of the image by dumping the whole pattern.  Recall that
  316. in the examples above, four "Adams" in the picture creates three "Adams" 
  317. in the image.  By dumping the pattern to start, we are simple providing 
  318. the first "Adam" to build the 3D image from.  Now, we start building the 
  319. 3D image.
  320.  
  321.         ASDFGHJK
  322.  
  323. Since the first 12 levels are at level 0, we do no adding nor deleting;
  324. just dump 12 more letters from the pattern in order.
  325.  
  326.         ASDFGHJKASDFGHJKASDF
  327.                 ^image starts here
  328.  
  329. We now have our first transition, from level 0 to 1.  Which letter do we
  330. delete?  Delete the next one in the pattern.  
  331.  
  332.         ASDFGHJK
  333.             ^the next letter in the pattern
  334.  
  335. Since G is next, we delete it.  Our new pattern is ASDFHJK, and H is the
  336. next letter to be used in the image.
  337.  
  338.         ASDFHJK
  339.             ^the next letter to use in the image
  340.  
  341. Forget about the G.  Consider it gone forever.  The input now indicates 
  342. five letters at level 1.  Since we made the transition to level one by 
  343. deleting the G, we simply copy the next 5 letters from the pattern into
  344. the image.  The next 5 letters in the pattern are HJKAS.  (You've noticed
  345. by now that we wrap around when we get to the end of the pattern.) I'll 
  346. lay the input next to our image to make it easier to see where we're at.
  347.  
  348.                 00000000000011111222221111111110000
  349.         ASDFGHJKASDFGHJKASDFHJKAS
  350.         {      }{          }{   }
  351.         initial  level 0    level
  352.         pattern             1
  353.  
  354. To jump up to level 2 from level 1, we delete the next letter in the 
  355. pattern, the letter D.  The new pattern is shown below.
  356.  
  357.         ASFHJK
  358.           ^the next letter to use
  359.  
  360. We have 5 letters at level 2, so we copy the next 5 letters from the 
  361. pattern, FHJKA, to the image.
  362.  
  363.                 00000000000011111222221111111110000
  364.         ASDFGHJKASDFGHJKASDFHJKASFHJKA
  365.         {      }{          }{   }{   }
  366.         initial  level 0    lev  level
  367.         pattern             1    2
  368.  
  369. We must now move down a level, from 2 to 1, by ADDING a letter to our
  370. pattern.  Where do we add it?  Add it as the next letter to use.  Let's
  371. add an X (randomly chosen letters work better than previously used 
  372. letters).  Since A was the last letter used, S is the next to be used.
  373.  
  374.         ASFHJK
  375.          ^add X here
  376.  
  377.         AXSFHJK
  378.          ^next letter to use
  379.  
  380. Since there are nine letters at level 1, we must copy nine letters 
  381. from the pattern to the image (XSFHJKAXS).
  382.  
  383.                 00000000000011111222221111111110000
  384.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXS
  385.         {      }{          }{   }{   }{       }
  386.         initial  level 0    lev  level level 1
  387.         pattern             1    2
  388.  
  389. Drop another level, from 1 to 0, by adding another letter to the pattern
  390. at the current position.
  391.  
  392.         AXSFHJK
  393.            ^add random letter (M) here
  394.  
  395.         AXSMFHJK
  396.            ^next letter to use
  397.  
  398. level 0, we copy four letters from the
  399. pattern to the image (MFHJ).
  400.  
  401.                 00000000000011111222221111111110000
  402.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  403.         {      }{          }{   }{   }{       }{  }
  404.         initial  level 0    lev  level level   lev
  405.         pattern             1    2     1       0
  406.  
  407. WE'RE DONE.  Kinda anti-climatic, huh?  Let's duplicate the image line
  408. to make it easier to view.
  409.  
  410.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  411.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  412.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  413.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  414.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  415.  
  416. For each new line in the image, start with a new random pattern, and
  417. follow the steps above.  So, how are graphics stereograms made?  The
  418. same way, using colored pixel values for input.  3drandot uses RED as
  419. the color deepest in the image, with GREEN in the middle, and BLUE as
  420. the highest color.
  421.  
  422. The pseudocode below follows this algorithm.  If you have any questions,
  423. post them in the newsgroup.  Let me know if you are interested in C code 
  424. that follows this algorithm.  (The C code here in the FAQ follows a 
  425. different algorithm, the "lookback" algorithm.)
  426.  
  427. Enjoy!!
  428. thale@novell.com
  429.  
  430.  
  431. -----------------------------------------------------------------------
  432. ----- STEREOGRAM ALGORITHM --------------------------------------------
  433. -----------------------------------------------------------------------
  434.  
  435. The following is an algorithm I developed for SIRDS generation.  It is 
  436. functionally equivalent to the look back algorithms, without looking back. 
  437. It can be used for graphic stereograms, as well as the text stereograms. 
  438. It simply stores in PATTERN the values we would look back at.  The input 
  439. file is depth data, or a z-buffer (see example input below).  The levels 
  440. available in a picture are the maximum pattern size divided by two minus 
  441. one.  Maximum pattern size should be equivalent to half the distance 
  442. between the eyes (for easy viewing), which is about 1 1/4 inches.  So, for 
  443. typical text stereograms on an 80 char display, that's about 10 characters 
  444. for the maximum pattern size and 4 or 5 levels available.  However, since 
  445. 4 or 5 levels is unreasonable, we push the max pattern size to 16 (still 
  446. less that the 20 character distance between the eyes).  This gives us about 
  447. 7 or 8 levels.
  448.  
  449. If we do allow more than 7 levels when the max pattern size is 16, the 
  450. repeating pattern (of size max pattern - current level) grows so small that 
  451. four of them in a row (e.g., of size 7) would also create two double 
  452. patterns in a row (of size 14), causing floaties (aliasing).  
  453.  
  454. I hope I'm making some sense.  I'll try to spend some time rewriting this. 
  455. In addition, I'll integrate answers to any questions that come as a result 
  456. of this mess!  In addition to the information here, we need to add a good 
  457. description of how they work (that is not covered here).
  458.  
  459.  
  460. PL : Previous Level value
  461. NL : Next Level value
  462.  
  463. INITIAL LEVEL SETTING
  464. PL = 0
  465.  
  466. OPEN INPUT FILE FOR READING
  467. WHILE NOT EOF (Y DIMENSION: FOR EACH LINE)
  468.  
  469.    GENERATE NEW PATTERN
  470.    SET PATTERN PTR TO BEGINNING OF PATTERN
  471.    OUTPUT FULL PATTERN
  472.  
  473.    WHILE NOT EOL (X DIMENSION: FOR EACH POSITION)
  474.  
  475.       NL = NEXT INPUT LEVEL VALUE
  476.       IF NL != PL (IF WE'RE CHANGING LEVELS)
  477.  
  478.          IF NL > PL (IF WE'RE MOVING UP)
  479.             DELETE NEXT NL-PL BITS IN PATTERN FROM PTR FORWARD
  480.             (IF GOING FROM LEVEL 0 TO 2, DELETE 2 BITS IN PATTERN)
  481.  
  482.          ELSE (IF MOVING DOWN, AWAY)
  483.             INSERT PL-NL RANDOM BITS INTO PATTERN AT PTR POSITION
  484.             (IF GOING FROM LEVEL 3 TO 2, INSERT 1 BIT INTO PATTERN)
  485.  
  486.          PL = NL (UPDATE PL)
  487.          OUTPUT NEXT VALUE IN PATTERN
  488.  
  489.       ELSE
  490.          OUTPUT NEXT VALUE IN PATTERN
  491.  
  492.       ADVANCE PATTERN PTR (CIRCULAR PATTERN)
  493.       ADVANCE INPUT PTR
  494.             
  495.  
  496. (Redundancy exists to simplify readability.)
  497.  
  498. Assuming spaces translate to level 0, input like this (thanks, Dave 
  499. Thomas):
  500.  
  501.  
  502.    22222222222222222          11111111111111111111111
  503.    2222222222222222222        11111111111111111111111
  504.    22222222222222222222       11111111111111111111111
  505.    22222          22222                11111
  506.    22222          22222                11111
  507.    22222          22222                11111
  508.    22222          22222                11111
  509.    22222          22222                11111
  510.    22222          22222                11111
  511.    22222222222222222222                11111
  512.    2222222222222222222                 11111
  513.    22222222222222222                   11111
  514.                                                                     
  515.                                                                     
  516. Yields output like this:
  517.  
  518. Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D
  519. mwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,
  520. 7Z,o:.sw5[rHt&{:7Z,osw5[rHt&{:7Z,osw505[rHt&{:7Zosw505[rHt&{:7Zosw505[rR
  521. g"EzQy{lW_3C&B[8g"Ez{lW_3C&B[8g"Ez{lW_3S3C&B[8g"z{lW_3S3C&B[8g"z{lW_3S3y
  522. yiQ?fiVF!G{TAtrJyiQ?VF!G{TAtrJyiQ?VF!G{T]TAtrJyi?VF!G{T]TAtrJyi?VF!G{T]s
  523. 1`I|r?FLoB#<sf!Q1`I|FLoB#T#<sf!Q1`ILoB#TaT#<sf!Q1`ILoB#Ta#<sf!#Q1`ILoB#T
  524. m$LuSD0hh7\qy5:nm$Lu0hh7\x\qy5:nm$Lhh7\x"x\qy5:nm$Lhh7\x"\qy5:-nm$Lhh7\x
  525. [#7hrqKUm`/<bic$[#7hKUm`/7/<bic$[#7Um`/7r7/<bic$[#7Um`/7r/<bick$[#7Um`/7
  526. L,'O)X\L&Xu)ZUw(L,'O\L&Xu|u)ZUw(L,'L&Xu|y|u)ZUw(L,'L&Xu|yu)ZUwy(L,'L&Xu|
  527. 3`#YPTdg:,;rmy9`3`#Ydg:,;(;rmy9`3`#g:,;(7(;rmy9`3`#g:,;(7;rmy94`3`#g:,;(
  528. 1w^N7d;f964U,yml1w^N;f964&4U,yml1w^f964&;&4U,yml1w^f964&;4U,ym{l1w^f964&
  529. <>Y8igID(]?"A0+;<>Y8ID(]?"A0+;<>Y8ID(]?"?"A0+;<>Y8ID(]?"?A0+;<O>Y8ID(]?"
  530. eRl5hfJx.cD0tscheRl5Jx.cD0tscheRl5Jx.cDeD0tscheRl5Jx.cDeDtscheiRl5Jx.cDe
  531. v,r7f6%<)R-AaV^hv,r7%<)R-AaV^hv,r7%<)p)R-AaV^hv,r7%<)p)R-aV^hv>,r7%<)p)R
  532. VbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]q
  533. `^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=
  534.  
  535.  
  536. This uses 16 as the Max pattern size.  Notice on the third line of the 
  537. output (the first line with level changes), the pattern is "7Z ... &{:".
  538. When we go from level 0 to level 2, we lose two characters (i.e., ":.").
  539. When we go from level 2 back to level 0, we insert two new characters 
  540. (i.e., "05" after the "osw5").
  541.  
  542. Any questions?  Or better yet, what did I leave out??  I do hope this helps 
  543. someone!?!
  544.  
  545.  
  546. -----------------------------------------------------------------------
  547. ----- SIRDS PUBLICATIONS ----------------------------------------------
  548. -----------------------------------------------------------------------
  549.  
  550. Search library databases with these keywords: Stereogram, Autostereogram, 
  551. SIRDS (Single Image Random Dot Stereogram), RDS.
  552.  
  553. >From E.Thompson@ncl.ac.uk:
  554. An excellent source of information (sample RDS and source code)
  555. is contained in Andrew A.Kinsman - Random Dot Stereograms
  556. ISBN 0-9630142-1-8  $13.95 U.S.  Published by Kinsman Physics, 
  557. P.O. Box 22682, Rochester, N.Y. 14692-2682
  558.  
  559. See the following periodicals:
  560. Journal of Imaging Science and Technology, May/June 1992, Vol 36, #3.
  561.    Slinker & Burton
  562. D. G. Stork and C. Rocca.  "Software for generating auto-random-dot
  563.     stereograms", _Behavior_Research_Methods,_Instruments,_and_Computers_,
  564.     Vol. 21, No. 5, 1989, pp. 525-534.
  565.  
  566.  
  567. SEND MORE REFERENCES!
  568.  
  569.  
  570.  
  571. -----------------------------------------------------------------------
  572. ----- C CODE TO GENERATE TEXT STEREOGRAMS -----------------------------
  573. -----------------------------------------------------------------------
  574.  
  575. Also from Dave Thomas:
  576.  
  577. Now here's a hack of a hack I found on the net.  Basically it generates
  578. stereograms from ascii diagrams.  Here's the program first:
  579.  
  580. #define DEPTH0  16
  581. #define COLS    79
  582.  
  583. #include <stdio.h>
  584.  
  585. main()
  586.    {
  587.    long now;
  588.    int col;
  589.    char m[COLS+1],s[COLS+1];
  590.    int i,e,c;
  591.  
  592.    /* seed random number generator */
  593.    time (&now);
  594.    srand (now);
  595.  
  596.    /* print fusion X's */
  597.    for (col = 0; COLS - col >= DEPTH0; col += DEPTH0)
  598.       {
  599.       for (i = 0; i < DEPTH0-1; ++i)
  600.          putchar (' ');
  601.       putchar ('X');
  602.       }
  603.    putchar ('\n');
  604.  
  605.    /* process input image */
  606.    while (memset(m,'\0',COLS+1),fgets (m, COLS+1, stdin))
  607.       {
  608.       e = 0;
  609.       s[COLS] = 0;
  610.       for(i=0; i<COLS; )
  611.          {
  612.          e = 0;
  613.          while (i >= DEPTH0 && i < COLS && 
  614.             (c = m[i - DEPTH0]) >= '0' && c <= '9')
  615.             {
  616.             e = 1;
  617.             s[i] = s[i-DEPTH0+c-'0'];
  618.             ++i;
  619.             }
  620.          s[i++] = (e || i < DEPTH0) ? randasc() : s[i-DEPTH0];
  621.          }
  622.       puts (s);
  623.       }
  624. }
  625.  
  626. randasc()
  627. {
  628.    /* large set of random characters */
  629.    return ('!'+rand()%92);
  630.  
  631.    /* lowercase random letters */
  632.    /* return ('a'+rand()%26); */
  633. }
  634.  
  635.  
  636. Try passing it this file as the standard input:
  637.                                 
  638.            22222222222222222           11111111111111111111111
  639.            2222222222222222222         11111111111111111111111
  640.            22222222222222222222        11111111111111111111111
  641.            22222          22222                 11111
  642.            22222          22222                 11111
  643.            22222          22222                 11111
  644.            22222          22222                 11111
  645.            22222          22222                 11111
  646.            22222          22222                 11111
  647.            22222222222222222222                 11111
  648.            2222222222222222222                  11111
  649.            22222222222222222                    11111
  650.                                                                         
  651.                                                                         
  652. You'll get output like this:
  653.  
  654.                X               X               X              X
  655. "i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D
  656. dZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,
  657. rHt&{:7Z,o:.sw5[rHt&{:7Z,osw5[rHt&{:7Z,osw505[rHt&{:7Zosw505[rHt&{:7Zosw505[rR
  658. 3C&B[8g"EzQy{lW_3C&B[8g"Ez{lW_3C&B[8g"Ez{lW_3S3C&B[8g"z{lW_3S3C&B[8g"z{lW_3S3y
  659. {TAtrJyiQ?fiVF!G{TAtrJyiQ?VF!G{TAtrJyiQ?VF!G{T]TAtrJyi?VF!G{T]TAtrJyi?VF!G{T]s
  660. #<sf!Q1`I|r?FLoB#<sf!Q1`I|FLoB#T#<sf!Q1`ILoB#TaT#<sf!Q1`ILoB#Ta#<sf!#Q1`ILoB#T
  661. \qy5:nm$LuSD0hh7\qy5:nm$Lu0hh7\x\qy5:nm$Lhh7\x"x\qy5:nm$Lhh7\x"\qy5:-nm$Lhh7\x
  662. /<bic$[#7hrqKUm`/<bic$[#7hKUm`/7/<bic$[#7Um`/7r7/<bic$[#7Um`/7r/<bick$[#7Um`/7
  663. u)ZUw(L,'O)X\L&Xu)ZUw(L,'O\L&Xu|u)ZUw(L,'L&Xu|y|u)ZUw(L,'L&Xu|yu)ZUwy(L,'L&Xu|
  664. ;rmy9`3`#YPTdg:,;rmy9`3`#Ydg:,;(;rmy9`3`#g:,;(7(;rmy9`3`#g:,;(7;rmy94`3`#g:,;(
  665. 4U,yml1w^N7d;f964U,yml1w^N;f964&4U,yml1w^f964&;&4U,yml1w^f964&;4U,ym{l1w^f964&
  666. ?"A0+;<>Y8igID(]?"A0+;<>Y8ID(]?"A0+;<>Y8ID(]?"?"A0+;<>Y8ID(]?"?A0+;<O>Y8ID(]?"
  667. D0tscheRl5hfJx.cD0tscheRl5Jx.cD0tscheRl5Jx.cDeD0tscheRl5Jx.cDeDtscheiRl5Jx.cDe
  668. -AaV^hv,r7f6%<)R-AaV^hv,r7%<)R-AaV^hv,r7%<)p)R-AaV^hv,r7%<)p)R-aV^hv>,r7%<)p)R
  669. IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]q
  670. BX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=
  671.  
  672.  
  673.  
  674. -----------------------------------------------------------------------
  675. ----- HOPE FOR THE HOPELESS :-) ---------------------------------------
  676. -----------------------------------------------------------------------
  677.  
  678. From: wchaga@vela.acs.oakland.edu (William C. Haga)
  679.  
  680. Being one who has used wide-eyed vision on chain link fences ever
  681. since I was a kid, I was able to see the images in SIRDS right
  682. away. But I've had difficulty explaining the technique to friends. 
  683. Today I had the latest Games magazine with me at my parents house. 
  684. Games is running another contest using SIRDS, so there are three in 
  685. the latest issue. This time I thought of the reflection idea. So I 
  686. opened mom's china cabinet, put the magazine against the glass in 
  687. the door, and told mom to keep looking at her own reflection in the 
  688. glass until the image appeared.
  689.  
  690. It took less than thirty seconds.
  691.  
  692. When she saw the 3d train engines, I was subjected to a squeal of
  693. delight that I hadn't heard from her for a long time. "EEK! IT'S
  694. COMING OUT AT ME! IS THIS EVER NEAT!".  Dad tried for about a minute
  695. but gave up.
  696.  
  697. About an hour later, mom and I heard a shout. We went to
  698. the dining area, and there was dad with the magazine against the
  699. glass in the door. "Isn't that just the most amazing thing!", said he.
  700.  
  701. Later they were making jokes about teaching old dogs new tricks.
  702.  
  703.  
  704. -----------------------------------------------------------------------
  705. ----- COMMERCIAL SIRDS Posters ----------------------------------------
  706. -----------------------------------------------------------------------
  707.  
  708. For those who do not have a local SIRDS distributor (i.e., the poster
  709. cart at the mall), here is one company you may be able to order from.
  710. The following posters are all certifiably cool with lots of great details,
  711. and come in nice colors.  They are (I believe) designed by NVision, or 
  712. something like that, and distributed here by Axis Corp.
  713.  
  714. Posters:
  715. $25 Dinosaurs
  716. $25 Discovery (Space shuttle and planet)
  717. $25 Lady Liberty (U.S. Statue of Liberty)
  718. $25 B-2 Stealth Bomber
  719. $25 F-117 Bomber
  720. $25 Nature's Majesty (Eagle with fish in talons, pine trees in bkgrd)
  721. $30 Calypso Reef (Ocean Scene--new design, more detail)
  722. Many more now, including small, $15 posters.
  723.  
  724. Axis Corp.
  725. 1732 S. 790 W.
  726. Salt Lake City, UT 84104 USA
  727. (801)977-8816
  728.  
  729. Include US$5 for shipping and a poster tube.  (The guy quoted me that price 
  730. for shipping to Australia.)  Or, you can pay US$17 for a tube in a box.  
  731. Although they haven't had any problems shipping in the poster tubes, they 
  732. only guarantee safe delivery in a well-packed box.
  733.  
  734. And, by no means am I associated with these guys at all, except I spend a
  735. lot of time enjoying their posters!  (i.e., this is not an ad, but a 
  736. response to a request for SIRDS access.)
  737.  
  738.  
  739. ALSO:
  740.  
  741. Infix Technologies
  742. PO Box 381
  743. Orem, UT 84057-0381
  744. (801) 221-9233
  745. contact: John M. Olsen, jolsen@nyx.cs.du.edu
  746.  
  747. Shipping now:
  748. 18x24 Earth (mercator projection of the Earth's altitudes)
  749. 18x24 Salt Lake LDS Temple Centennial
  750. 18x24 Beethoven (300 DPI!  Very smooth.)
  751.  
  752. (others are coming soon, too.)
  753.  
  754. Retail price for the 18x24 inch prints is $20 plus $3 s/h.  Utah residents
  755. add 6.25% sales tax.  Wholesale and distributor discounts are available.
  756. Quotes for custom work are also available.  Cost and minimum order varies, 
  757. based on content.
  758.  
  759.  
  760.  
  761.