home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 15 / cdrt15.iso / pc / library / sirdfa.txt < prev    next >
Internet Message Format  |  1994-04-24  |  39KB

  1. From: thale@novell.com (Todd D. Hale)
  2. Newsgroups: alt.3d
  3. Subject: SIRDS/Stereogram/Stare-E-O FAQ
  4. Date: Mon, 4 Apr 1994 23:16:54 GMT
  5. Organization: Novell, Inc., Provo, UT, USA
  6. Lines: 897
  7. Message-ID: <thale.20.2DA09FE5@novell.com>
  8. NNTP-Posting-Host: thale.npd.provo.novell.com
  9.  
  10. The following is a smattering of info I've collected about SIRDS.  It is not 
  11. totally organized, nor complete, but it answers a lot of FAQs out there.  
  12. Please submit any updates/changes to me at thale@novell.com.
  13.  
  14. The following sections are covered herein:
  15.  
  16.    Stereogram Terminology
  17.    Stereogram FTP Sites
  18.    Commercial SIRDS Software
  19.    Stereogram Publications
  20.    Sample TEXT Stereograms
  21.    How Single Images Stereograms work
  22.    Stereogram Algorithm
  23.    C Code to Generate SIRTS
  24.    Hope for the Hopeless
  25.    Commercial Stereogram Producers
  26.  
  27.  
  28.  
  29. -----------------------------------------------------------------------
  30. ----- STEREOGRAM TERMINOLOGY ------------------------------------------
  31. -----------------------------------------------------------------------
  32.  
  33. The definitions below are listed hierarchically (a SIRDS is a SIS is a 
  34. Stereogram):
  35.  
  36. Stereogram   
  37.              Any stereo picture using stereo pairs or multiple repeating 
  38.              patterns
  39.    Stereo Pair
  40.              Two pictures from slightly different viewpoints, as used in
  41.              the old handheld viewers and viewmasters
  42.    SIS (Single Image Stereogram), Autostereogram
  43.              Includes SIRDS, SIRTS, Single Image Rendered Data Stereogram; 
  44.              extends stereo pair concept to "stereo megtuples"
  45.       SIRDS (Single Image Random Dot Stereogram), RDS, AutoRDS, Random
  46.              Dot Anaglyphs
  47.              Repeating image is made up of random dots
  48.       RLS (Random Line Stereogram)
  49.              Original repeating image is made up of vertical lines of 
  50.              varying widths; very instructional, see Slinker and Burton
  51.              paper
  52.       SIRTS (Single Image Random Text Stereograms), ASCII stereograms
  53.              Repeating image is made up of random text characters
  54.       SITS?
  55.              Non random text stereograms; see Sample Text Stereograms,
  56.              done manually for sigs and such
  57.  
  58. a SIRD (Single Image Random Dot) 
  59.              not much to view in a dot; used by newbies :-)
  60. Wall-eyed viewing   
  61.              Viewing stereograms by focusing past the actual image
  62. Cross-eyed viewing  
  63.              Viewing stereograms by focusing in front of the image
  64. Focusing to infinity   
  65.              Forcing your eyes' lines of sight into parallel, NOT 
  66.              necessary for wall-eyeing SIRDS! (only occurs when the length
  67.              of the repeating pattern = distance between centers of eyes)
  68.  
  69.  
  70. -----------------------------------------------------------------------
  71. ----- STEREOGRAM FTP SITES --------------------------------------------
  72. -----------------------------------------------------------------------
  73.  
  74. Submissions from michael@eccles.anu.edu.au, E.Thompson@newcastle.ac.uk, 
  75. kbaum@novell.com, ...:
  76.  
  77. THE FTP SITE for Stereograms is KATZ:
  78. katz.anu.edu.au ()
  79.   /pub/stereograms
  80.     00Index.txt  - This listing
  81.     00Readme.txt - An introduction to this site
  82.     ls-lR        - Full list of files under this directory
  83.     SIRDS.FAQ    - This file, created by Todd Thale (thale@novell.com)
  84.     ascii/       - ASCII stereograms
  85.     blue_red/    - Stereograms requiring Blue/Red glasses
  86.     een/         - Single Image Stereograms created by EEN
  87.                    in both TIFF and BMP formats
  88.     images/      - Single Image Stereograms (some GIF and PS)
  89.     ls-lR        - Directory listing of all stereogram files
  90.     papers/      - Papers on single image stereograms
  91.     programs/    - Programs for creating and viewing stereograms (IBM, 
  92.                    X and Unix)
  93.     mac/         - Programs and Images for Apple Macintosh computers
  94.     acorn/       - Programs and Images for Acorn Archimedes range of 
  95.                    computers
  96.  
  97. WWW access for MOSAIC users:
  98.   http://h2.ph.man.ac.uk/gareth/sirds.html
  99.     From Gareth Richards (gareth@v2.ph.man.ac.uk, richards@cernvm.cern.ch,
  100.     gareth@h2.ph.man.ac.uk)
  101.  
  102. OTHERS (Most of this is available at katz, above):
  103. ftp.uwp.edu (131.210.1.4)
  104.   /pub/msdos/picture.viewers/rdsdraw.zip
  105.     EXCELLENT SIRDS painting/generating program.  CHECK IT OUT!
  106. oak.oakland.edu
  107.   /pub/msdos/graphics/mindim20.zip
  108.   /pub/msdos/graphics/sirdvu11.zip
  109.   /pub/msdos/graphics/perspect.zip
  110. wuarchive.wustl.edu (128.252.135.4) 
  111.   /pub/xpgs/xpgs
  112.   /pub/MSDOS_UPLOADS/graphics/dynamic.exe
  113.   /graphics/graphics/mirrors/sugrfx.acs.syr.edu/3d/randot/3drandot.zoo
  114. sunsite.unc.edu
  115.   /pub/academic/computer-science/virtual-reality/3d/*
  116. ftp.cs.waikato.ac.nz
  117.   /pub/papers/???.tar.Z
  118. gwaihir.dd.chalmers.se
  119.   pub/een/SIS/*.tif
  120.   pub/een/Dirk-SIS/*.tif   <-- GET THESE (not on katz, yet)
  121.  
  122.  
  123.  
  124. -----------------------------------------------------------------------
  125. ----- COMMERCIAL SIRDS SOFTWARE ---------------------------------------
  126. -----------------------------------------------------------------------
  127.  
  128. STW_DEMO.EXE: the full package will allow RDS creation
  129.    Approx 40$
  130.    N.E.Thing Enterprises
  131.    P.O. Box 1827
  132.    Cambridge, MA 02139
  133.  
  134. A company called I/O Software, Inc. (909/483-5700 800/800-7970)
  135. has a program called STEREOLUSIONS.  It works on both WINDOWS and
  136. Windows NT and allows people to create, render and even print SIRDS on
  137. any Windows compatible machine.  (From William Saito, 3/07/94)
  138.  
  139. KAI's POWER TOOLS for the MAC has a Photoshop add-on for SIS creation.
  140.  
  141. Stareo-3D ??
  142.  
  143. SEND MORE INFO!
  144.  
  145.  
  146. -----------------------------------------------------------------------
  147. ----- STEREOGRAM PUBLICATIONS -----------------------------------------
  148. -----------------------------------------------------------------------
  149.  
  150. Search library databases with these keywords: Stereogram, Autostereogram, 
  151. SIRDS (Single Image Random Dot Stereogram), RDS.
  152.  
  153. Considered by most as the original work on Random Dot Stereograms: 
  154. 'Principles of Cyclopean Perception' by Bela Julesz, from MIT press, circa
  155. 1972.
  156. >Charles Eicher (CEicher@Halcyon.com)
  157.  
  158. An excellent source of information (sample RDS and source code)
  159. is contained in Andrew A.Kinsman - Random Dot Stereograms
  160. ISBN 0-9630142-1-8  $13.95 U.S.  Published by Kinsman Physics, 
  161. P.O. Box 22682, Rochester, N.Y. 14692-2682
  162. >E.Thompson@ncl.ac.uk
  163.  
  164. Journal of Imaging Science and Technology, May/June 1992, Vol 36, #3.
  165. Slinker & Burton.  Their use of random line stereograms really helps
  166. to understand how stereograms work, as well as some of their limitations.
  167.  
  168. New Scientist (9 October 1993) has a 4 page article on SIRDS. There is a 
  169. pretty cool example too.
  170. >Simon Dear (sd@mrc-lmb.cam.ac.uk)
  171.  
  172. David G. Stork and Chris Rocca.  "Software for generating auto-random-dot
  173. stereograms", Behavior Research Methods, Instruments, and Computers,
  174. Vol. 21, No. 5, 1989, pp. 525-534.
  175. >Steve Tate (srt@cs.unt.edu)
  176.  
  177.  
  178. "Stereo Computer Graphics and Other True 3D Technologies"
  179. David F. McAllister, Ed.
  180. Princeton University Press, 1993
  181. ISBN 0-691-08741-5   US$75.00
  182. It has several nice color plates, with stereo "triads".  The triads consist
  183. of a left, a right, then another left image.  Use the left pair for viewing
  184. walleyed, or the right pair for viewing crosseyed.
  185. >Mike Weiblen (mew@digex.net)
  186.  
  187. "Stereogram" (c) 1994, Cadence Books, San Francisco, CA
  188. "a newly edited version of CG STEREOGRAM and CG STEREOGRAM 2,
  189. published by Shogakukan Inc. In Tokyo, Japan"
  190. ISBN 0-929279-85-9
  191. Cadence Books, A division of Viz Communications, Inc.
  192. P.O. Box 77010
  193.      I liked it.  Much better in my opinion than the other Stereogram
  194. book I've seen ("Magic Eye").  This one includes much textual
  195. information, including the origins of stereograms, how to see them,
  196. precursors such as stereo pairs, and an article by Christopher W.
  197. Tyler, who invented the SIRDS.
  198.      Best of all were the stereograms themselves.  There are roughly
  199. 50 SIRDS, most of them full page (the book is softcover and about 8"
  200. square).  The ones I've managed to see so far have been quite good,
  201. and also included are some of the very first ones.  In the history
  202. department there are stereo pairs, stereo photographs, and even some
  203. stereo-pair paintings by Salvador Dali.
  204.      All of the stereograms indicate whether they require wall-eyed or
  205. cross-eyed viewing (or either).  Most are true 3d designs, not the
  206. "cutout" variety.
  207.       The book is 93 pages and most of the plates are full-color.
  208. Well worth the money in my opinion.
  209. >Michael Moncur (mgm@xmission.com)
  210.  
  211. _Magic Eye: A New Way of Looking at the World_
  212. copyright (c) 1993 by N.E. Thing Enterprises.
  213. Andrews and McMeel, A Universal Press Syndicate Company, Kansas City
  214. ISBN: 0-8362-7006-1
  215. First Printing, September 1993 ... Fifth Printing, January 1994
  216. Introduction contains a history of the technique and phenomena.
  217. Viewing Techniques are explained.  25 pages of full-color STARE-E-O images.
  218. (Plus images inside the front and back covers.)  "Answers" included.
  219. 32 pages, hardcover, 8.75x11.5 inches, horizontal format, with slipcover.
  220. US$12.95 ($16.95/Canada)
  221. I just bought this for US$7.77 at Media Play in Utah.  It's currently on
  222. their best seller list.  Well worth any price under $30!  
  223. >Todd Hale, 3/25/94
  224.  
  225. Magic Eye II: Three Dimension Trip Vision
  226. Copyright 1992 by N.E. Thing Enterprises/Tenyo Co., Ltd.
  227. Korean Translation Copyright 1993 by Chungrim Publishing Co.
  228. All the text is in Korean, so I can't read it.  But it has some pretty
  229. cool pictures.  They are all SIRxS where x is various patterns/pictures.
  230. I paid US$20 for it.  Interestingly, this title doesn't seem to be mentioned
  231. in my N.E. Thing catalog.
  232. >Mark Hudson (M_Hudson@delphi.com)
  233.  
  234. SEND MORE REFERENCES!
  235.  
  236.  
  237. -----------------------------------------------------------------------
  238. ----- SAMPLE TEXT Stereograms (Not random) ----------------------------
  239. -----------------------------------------------------------------------
  240.  
  241. From: dthomas@bbx.basis.com (Dave Thomas)
  242.  
  243.                             O   O
  244. n   n   n   n   n   n   n   n   n   n   n   n   n   n   n  n
  245. f    f    f    f    f    f    f    f    f    f    f    f   f
  246. e   e   e   e   e   e   e   e   e   e   e   e   e   e   e  e
  247. a    a    a    a    a    a    a    a    a    a    a    a   a
  248. a   a   a   a   a   a   a   a   a   a   a   a   a   a   a  a
  249. r    r    r    r    r    r    r    r    r    r    r    r   r
  250. r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  251.  
  252.  
  253.  
  254. 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
  255. r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r
  256.  e    e    e    e    e    e    e    e    e    e    e    e    e    e    e
  257. a     a     a     a     a     a     a     a     a     a     a     a     a
  258.  t      t      t      t      t      t      t      t      t      t      t
  259. <<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>><<<<>>>>
  260.  d      d      d      d      d      d      d      d      d      d      d
  261. e     e     e     e     e     e     e     e     e     e     e     e     e
  262.  p    p    p    p    p    p    p    p    p    p    p    p    p    p    p
  263. t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t
  264. 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
  265.  
  266.  
  267. From: jittlov@gumby.cs.caltech.edu (Mike Jittlov)
  268.        .    .          .    .          .    .           .    .
  269.            @  .           @   .          @    .          @     .
  270. >     /^\           /^\           /^\           /^\           /^\
  271. > ####################################################################
  272. > ####################################################################
  273. >  /    ####     /   ####\     /  #### \     / ####  \     /####   \
  274. >/       ## \__/      ##  \__/     ##   \__/    ##    \__/   ##     \
  275. >   ____ ##     ____  ##    ____   ##   ____    ##  ____     ## ____
  276. >  /    \##    /    \ ##   /    \  ##  /    \   ## /    \    ##/    \
  277. > |  2D  |#   |  2D  |##  |  2D  | ## |  2D  |  ##|  2D  |   #|  2D  |
  278. > |  or  |#   |  or  |##  |  or  | ## |  or  |  ##|  or  |   #|  or  |
  279. > |  3D  |#   |  3D  |##  |  3D  | ## |  3D  |  ##|  3D  |   #|  3D  |
  280. > |  ??  |#   |  ??  |##  |  ??  | ## |  ??  |  ##|  ??  |   #|  ??  |
  281. > |      |    |      |    |      |    |      |    |      |    |      |
  282. > --------    --------    --------    --------    --------    --------
  283. >  \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\    \\\\\\\\
  284. >   \\\\\\\\    \\\\\\\\    \\\n\r\\    \\f\o\d\    \\\\\\\\    \\\\\\\\
  285. >     \\\\\\      \\\\\\      \\\\\\      \\\\\\      \\\\\\      \\\\\\
  286. >                                                            DR J
  287.  
  288. _____________________________________________________________________________
  289.  [] [] [] | [] [] [] [] | [] [] [] [] | [] [] [] [] | [] [] [] [] | [] [] [] 
  290. =============================================================================
  291.         * :         *   :       *     :     *       :   *         : *        
  292.       .' `:       .' `. :     .' `.   :   .' `.     : .' `.       :' `.        
  293. Mike Jittlov Mike.Jittlov Mike Jittlov.Mike Jittlov Mike Jittlov Mike Jittlov
  294.  The Wizard`  The Wizard.  The Wizard . The Wizard  .The Wizard  'The Wizard 
  295. *   * of  . *   *  of   *   *   of  * . *    of *   *     of*   * .    o*   *
  296. |\^/|peed . |\^/|Speed  |\^/| Speed |\^/|  Speed|\^/|   Spee|\^/| .  Spe|\^/|
  297.  \V/ and  .  \V/  and   .\V/   and   \V/    and  \V/.    and \V/  .   and\V/ 
  298.  /_\Time! .  /_\ Time!  ./_\  Time!  /_\   Time! /_\.   Time!/_\  .  Time/_\ 
  299. _/ \_     . _/ \_       _/ \_       _/.\_       _/ \_       _/ \_ .     _/ \_
  300. =============================================================================
  301. WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
  302. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  303.  
  304.  
  305. One more from ... well ... YOU figure it out!
  306.  
  307. _-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~
  308. !   Adam      Adam      Adam      Adam      Adam      Adam   ! "Lawn       !
  309. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg!   service!" !
  310. !   Adam      Adam      Adam      Adam      Adam      Adam   !       -Stup !
  311. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg!             !
  312. !   Adam      Adam      Adam      Adam      Adam      Adam   !  atspragg@  !
  313. !Spragg   Spragg   Spragg   Spragg   Spragg   Spragg   Spragg! ucdavis.edu !
  314. !   Adam      Adam      Adam      Adam      Adam      Adam   !   GO AGS!   !
  315. _-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~-_-~
  316.  
  317.  
  318.  
  319. -----------------------------------------------------------------------
  320. ----- How Single Image Stereograms Work -------------------------------
  321. -----------------------------------------------------------------------
  322.  
  323. Let's start with a simple repeating pattern.  First we'll examine viewing
  324. stereograms wall-eyed (focusing beyond the picture).
  325.  
  326.               Adam
  327. Adam                       Adam          <-- PERCEIVED IMAGE (3D)
  328.   \ 
  329.    \ \
  330.     \   \
  331.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  332.      \       \
  333.       \         \                        <-- LINES OF SIGHT FROM EACH EYE
  334.        \           \
  335.        (*)           (*)                 <-- EYES
  336.  
  337. As shown in the above graphic, the lines of sight go through different
  338. (but identical) words.  The eyes must be directed to just the right level
  339. behind the picture to get the two "Adams" to line up.  When they do line 
  340. up, a single "Adam" appears at the level shown behind the picture.  
  341.  
  342. This is why it is easiest for some people to look at stereograms behind
  343. glass.  You simply look at your reflection, which appears to be behind
  344. the glass at about the same level as the 3d stereogram image.  More on
  345. this later.
  346.  
  347. So, why is the second "Adam" in the above image "deeper" than the other
  348. two?  Since the next two "Adams" that line up are FARTHER apart than the
  349. first two, your eyes must diverge a little more to get them to line up.  
  350. As the eyes diverge, their lines of sight meet a little further away.
  351. This causes the next "Adam" to appear deeper in the image.
  352.  
  353.               Adam
  354. Adam           |           Adam          <-- PERCEIVED IMAGE (3D)
  355.               / \
  356.              /   \
  357.             /     \
  358.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  359.            /       \
  360.           /         \                    <-- LINES OF SIGHT FROM EACH EYE
  361.          /           \
  362.        (*)           (*)                 <-- EYES
  363.  
  364. The above graphic was crammed into 10 lines of text.  If we moved the 
  365. eyes back (to a more realistic distance), the whole 3d image would 
  366. appear deeper, and not so spread out.
  367.  
  368. Cross-eyed viewing follows the same principles, but brings the focal point
  369. up front of the picture and inverts the image.  I'll use the same eyes and
  370. picture, but move the eyes back for room to illustrate.
  371.  
  372.     Adam  Adam   Adam  Adam              <-- ACTUAL PICTURE (Flat, 2D)
  373.        \   |
  374.          \|
  375.          Adam                            <-- PERCEIVED IMAGE (3D)
  376.          |   \
  377.          |     \
  378.         |         \                      <-- LINES OF SIGHT FROM EACH EYE
  379.         |           \
  380.        (*)           (*)                 <-- EYES
  381.  
  382. Now for the inverse part.  Since the next two "Adams" are farther apart,
  383. you must cross your eyes MORE (converge instead of diverge your eyes) to
  384. get the "Adams" to overlap.  This causes the next "Adam" in the image to
  385. appear closer than the first one.
  386.  
  387.     Adam  Adam    Adam  Adam             <-- ACTUAL PICTURE (Flat, 2D)
  388.            \      /
  389.             \    /
  390.          Adam\ / Adam                    <-- PERCEIVED IMAGE (3D)
  391.              Adam
  392.              /  \
  393.            /      \                      <-- LINES OF SIGHT FROM EACH EYE
  394.          /          \
  395.        (*)           (*)                 <-- EYES
  396.  
  397. Whew.  Ascii graphics are a bit too tight to be very technical.  By the
  398. way, each letter (or pixel) in the 3D image comes from two letters in
  399. the picture.  Stereograms have blurry edges (right and left edges) 
  400. because the line of sight from the one eye passes through the picture, 
  401. but the line of sight from the other eye is off the picture.  Examine
  402. the wall-eyed example below.
  403.  
  404.                      Adam
  405.        Adam                       Adam     <-- PERCEIVED IMAGE (3D)
  406. \               
  407.   \ \
  408.     \   \
  409.        \   Adam  Adam   Adam  Adam         <-- ACTUAL PICTURE (Flat, 2D)
  410.          \     \
  411.             \       \                      <-- LINES OF SIGHT
  412.               \           \          
  413.               (*)           (*)            <-- EYES
  414.  
  415. Here, the line of sight for the right eye goes through first "Adam" 
  416. in the picture, and the line of sight for the left eye is off the
  417. picture.  (Everything to the left of the first "Adam" in the IMAGE 
  418. is blurry.)
  419.  
  420.  
  421. HOW TO GENERATE STEREOGRAMS
  422.  
  423. Random stereograms work the same way; they simple repeat random text or
  424. pixels, instead of words like the "Adam" used above.  Below, the pattern, 
  425. "ASDFGHJK", is repeated four times in each line.  (I duplicated it for
  426. easier viewing.)
  427.  
  428.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  429.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  430.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  431.  
  432. As you might guess, the image consists of THREE repetitions of the 
  433. pattern, set back behind the picture (wall-eyed).  To add some varying
  434. depth to the image, we can simple add a space in the middle; or better,
  435. we'll add a different letter, the letter Q.  I've also dropped the K
  436. off the end to keep it suitable for framing. :-)
  437.  
  438.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  439.          ASDFGHJKASDFGHJKASQDFGHJKASDFGHJ
  440.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  441.  
  442. Adding the Q has the same effect as adding the space between "Adams"
  443. in the previous example.  Here it is again for comparison.
  444.  
  445.          Adam Adam Adam Adam Adam Adam
  446.          Adam Adam Adam  Adam Adam Ada
  447.          Adam Adam Adam Adam Adam Adam
  448.  
  449. These two stereograms demonstrate going down a level (deeper, for wall-
  450. eyed viewers) by adding a new letter where you want to go down.  The
  451. image returns back to the original level because the added letter was
  452. not repeated down the line; it was essentially deleted again.  Hence,
  453. deleting a letter causes the image to come forward one level.  Lets 
  454. look at this by deleting a letter before adding any.
  455.  
  456.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  457.          ASDFGHJKASDFGJKASDFGHJKASDFGHJKA
  458.          ASDFGHJKASDFGHJKASDFGHJKASDFGHJK
  459.  
  460. I deleted an H from the middle row, and added an A on the end to make
  461. it flush again.  This causes the image to come up a level where the H
  462. was deleted, then go back down where the H returns to the pattern.
  463.  
  464. To fully control the ups and downs of stereogram generation, you simply
  465. keep track of what's repeating and add and delete letters when needed.
  466. For example, start with the pattern ASDFGHJK.  If the input for the 3D
  467. stereogram image is 00000000000011111222221111111110000, where the 
  468. numbers represent the levels of the 3D image, you simply delete a letter
  469. from the pattern when you go up a level (0 to 1, or 1 to 2), and add a
  470. letter to the pattern when you go down a level (2 to 1, or 1 to 0).
  471.  
  472. If you want to go up multiple levels, e.g., from level 1 to 3, delete
  473. 2 letters from your pattern.  Adding two letters to the pattern likewise
  474. causes a two-level drop in the image.
  475.  
  476. Start each line of the image by dumping the whole pattern.  Recall that
  477. in the examples above, four "Adams" in the picture creates three "Adams" 
  478. in the image.  By dumping the pattern to start, we are simple providing 
  479. the first "Adam" to build the 3D image from.  Now, we start building the 
  480. 3D image.
  481.  
  482.         ASDFGHJK
  483.  
  484. Since the first 12 levels are at level 0, we do no adding nor deleting;
  485. just dump 12 more letters from the pattern in order.
  486.  
  487.         ASDFGHJKASDFGHJKASDF
  488.                 ^image starts here
  489.  
  490. We now have our first transition, from level 0 to 1.  Which letter do we
  491. delete?  Delete the next one in the pattern.  
  492.  
  493.         ASDFGHJK
  494.             ^the next letter in the pattern
  495.  
  496. Since G is next, we delete it.  Our new pattern is ASDFHJK, and H is the
  497. next letter to be used in the image.
  498.  
  499.         ASDFHJK
  500.             ^the next letter to use in the image
  501.  
  502. Forget about the G.  Consider it gone forever.  The input now indicates 
  503. five letters at level 1.  Since we made the transition to level one by 
  504. deleting the G, we simply copy the next 5 letters from the pattern into
  505. the image.  The next 5 letters in the pattern are HJKAS.  (You've noticed
  506. by now that we wrap around when we get to the end of the pattern.) I'll 
  507. lay the input next to our image to make it easier to see where we're at.
  508.  
  509.                 00000000000011111222221111111110000
  510.         ASDFGHJKASDFGHJKASDFHJKAS
  511.         {      }{          }{   }
  512.         initial  level 0    level
  513.         pattern             1
  514.  
  515. To jump up to level 2 from level 1, we delete the next letter in the 
  516. pattern, the letter D.  The new pattern is shown below.
  517.  
  518.         ASFHJK
  519.           ^the next letter to use
  520.  
  521. We have 5 letters at level 2, so we copy the next 5 letters from the 
  522. pattern, FHJKA, to the image.
  523.  
  524.                 00000000000011111222221111111110000
  525.         ASDFGHJKASDFGHJKASDFHJKASFHJKA
  526.         {      }{          }{   }{   }
  527.         initial  level 0    lev  level
  528.         pattern             1    2
  529.  
  530. We must now move down a level, from 2 to 1, by ADDING a letter to our
  531. pattern.  Where do we add it?  Add it as the next letter to use.  Let's
  532. add an X (randomly chosen letters work better than previously used 
  533. letters).  Since A was the last letter used, S is the next to be used.
  534.  
  535.         ASFHJK
  536.          ^add X here
  537.  
  538.         AXSFHJK
  539.          ^next letter to use
  540.  
  541. Since there are nine letters at level 1, we must copy nine letters 
  542. from the pattern to the image (XSFHJKAXS).
  543.  
  544.                 00000000000011111222221111111110000
  545.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXS
  546.         {      }{          }{   }{   }{       }
  547.         initial  level 0    lev  level level 1
  548.         pattern             1    2
  549.  
  550. Drop another level, from 1 to 0, by adding another letter to the pattern
  551. at the current position.
  552.  
  553.         AXSFHJK
  554.            ^add random letter (M) here
  555.  
  556.         AXSMFHJK
  557.            ^next letter to use
  558.  
  559. Since there are four letters at level 0, we copy four letters from the
  560. pattern to the image (MFHJ).
  561.  
  562.                 00000000000011111222221111111110000
  563.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  564.         {      }{          }{   }{   }{       }{  }
  565.         initial  level 0    lev  level level   lev
  566.         pattern             1    2     1       0
  567.  
  568. WE'RE DONE.  Kinda anti-climatic, huh?  Let's duplicate the image line
  569. to make it easier to view.
  570.  
  571.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  572.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  573.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  574.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  575.         ASDFGHJKASDFGHJKASDFHJKASFHJKAXSFHJKAXSMFHJ
  576.  
  577. For each new line in the image, start with a new random pattern, and
  578. follow the steps above.  So, how are graphics stereograms made?  The
  579. same way, using colored pixel values for input.  3drandot uses RED as
  580. the color deepest in the image, with GREEN in the middle, and BLUE as
  581. the highest color.
  582.  
  583. The pseudocode below follows this algorithm.  If you have any questions,
  584. post them in the newsgroup.  Let me know if you are interested in C code 
  585. that follows this algorithm.  (The C code here in the FAQ follows a 
  586. different algorithm, the "lookback" algorithm.)
  587.  
  588. Enjoy!!
  589. thale@novell.com
  590.  
  591.  
  592. -----------------------------------------------------------------------
  593. ----- STEREOGRAM ALGORITHM --------------------------------------------
  594. -----------------------------------------------------------------------
  595.  
  596. The following is an algorithm I developed for SIRDS generation.  It is 
  597. functionally equivalent to the look back algorithms, without looking back. 
  598. It can be used for graphic stereograms, as well as the text stereograms. 
  599. It simply stores in PATTERN the values we would look back at.  The input 
  600. file is depth data, or a z-buffer (see example input below).  The levels 
  601. available in a picture are the maximum pattern size divided by two minus 
  602. one.  Maximum pattern size should be equivalent to half the distance 
  603. between the eyes (for easy viewing), which is about 1 1/4 inches.  So, for 
  604. typical text stereograms on an 80 char display, that's about 10 characters 
  605. for the maximum pattern size and 4 or 5 levels available.  However, since 
  606. 4 or 5 levels is unreasonable, we push the max pattern size to 16 (still 
  607. less that the 20 character distance between the eyes).  This gives us about 
  608. 7 or 8 levels.
  609.  
  610. If we do allow more than 7 levels when the max pattern size is 16, the 
  611. repeating pattern (of size max pattern - current level) grows so small that 
  612. four of them in a row (e.g., of size 7) would also create two double 
  613. patterns in a row (of size 14), causing floaties (aliasing).  
  614.  
  615. I hope I'm making some sense.  I'll try to spend some time rewriting this. 
  616. In addition, I'll integrate answers to any questions that come as a result 
  617. of this mess!
  618.  
  619.  
  620. PL : Previous Level value
  621. NL : Next Level value
  622.  
  623. INITIAL LEVEL SETTING
  624. PL = 0
  625.  
  626. OPEN INPUT FILE FOR READING
  627. WHILE NOT EOF (Y DIMENSION: FOR EACH LINE)
  628.  
  629.    GENERATE NEW PATTERN
  630.    SET PATTERN PTR TO BEGINNING OF PATTERN
  631.    OUTPUT FULL PATTERN
  632.  
  633.    WHILE NOT EOL (X DIMENSION: FOR EACH POSITION)
  634.  
  635.       NL = NEXT INPUT LEVEL VALUE
  636.       IF NL != PL (IF WE'RE CHANGING LEVELS)
  637.  
  638.          IF NL > PL (IF WE'RE MOVING UP)
  639.             DELETE NEXT NL-PL BITS IN PATTERN FROM PTR FORWARD
  640.             (IF GOING FROM LEVEL 0 TO 2, DELETE 2 BITS IN PATTERN)
  641.  
  642.          ELSE (IF MOVING DOWN, AWAY)
  643.             INSERT PL-NL RANDOM BITS INTO PATTERN AT PTR POSITION
  644.             (IF GOING FROM LEVEL 3 TO 2, INSERT 1 BIT INTO PATTERN)
  645.  
  646.          PL = NL (UPDATE PL)
  647.          OUTPUT NEXT VALUE IN PATTERN
  648.  
  649.       ELSE
  650.          OUTPUT NEXT VALUE IN PATTERN
  651.  
  652.       ADVANCE PATTERN PTR (CIRCULAR PATTERN)
  653.       ADVANCE INPUT PTR
  654.             
  655. (Redundancy exists to simplify readability.)
  656.  
  657. Assuming spaces translate to level 0, input like this (thanks, Dave 
  658. Thomas):
  659.  
  660.  
  661.    22222222222222222          11111111111111111111111
  662.    2222222222222222222        11111111111111111111111
  663.    22222222222222222222       11111111111111111111111
  664.    22222          22222                11111
  665.    22222          22222                11111
  666.    22222          22222                11111
  667.    22222          22222                11111
  668.    22222          22222                11111
  669.    22222          22222                11111
  670.    22222222222222222222                11111
  671.    2222222222222222222                 11111
  672.    22222222222222222                   11111
  673.                                                                         
  674.                                                                         
  675. Yields output like this:
  676.  
  677. Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D
  678. mwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,
  679. 7Z,o:.sw5[rHt&{:7Z,osw5[rHt&{:7Z,osw505[rHt&{:7Zosw505[rHt&{:7Zosw505[rR
  680. g"EzQy{lW_3C&B[8g"Ez{lW_3C&B[8g"Ez{lW_3S3C&B[8g"z{lW_3S3C&B[8g"z{lW_3S3y
  681. yiQ?fiVF!G{TAtrJyiQ?VF!G{TAtrJyiQ?VF!G{T]TAtrJyi?VF!G{T]TAtrJyi?VF!G{T]s
  682. 1`I|r?FLoB#<sf!Q1`I|FLoB#T#<sf!Q1`ILoB#TaT#<sf!Q1`ILoB#Ta#<sf!#Q1`ILoB#T
  683. m$LuSD0hh7\qy5:nm$Lu0hh7\x\qy5:nm$Lhh7\x"x\qy5:nm$Lhh7\x"\qy5:-nm$Lhh7\x
  684. [#7hrqKUm`/<bic$[#7hKUm`/7/<bic$[#7Um`/7r7/<bic$[#7Um`/7r/<bick$[#7Um`/7
  685. 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|
  686. 3`#YPTdg:,;rmy9`3`#Ydg:,;(;rmy9`3`#g:,;(7(;rmy9`3`#g:,;(7;rmy94`3`#g:,;(
  687. 1w^N7d;f964U,yml1w^N;f964&4U,yml1w^f964&;&4U,yml1w^f964&;4U,ym{l1w^f964&
  688. <>Y8igID(]?"A0+;<>Y8ID(]?"A0+;<>Y8ID(]?"?"A0+;<>Y8ID(]?"?A0+;<O>Y8ID(]?"
  689. eRl5hfJx.cD0tscheRl5Jx.cD0tscheRl5Jx.cDeD0tscheRl5Jx.cDeDtscheiRl5Jx.cDe
  690. v,r7f6%<)R-AaV^hv,r7%<)R-AaV^hv,r7%<)p)R-AaV^hv,r7%<)p)R-aV^hv>,r7%<)p)R
  691. VbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]q
  692. `^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=
  693.  
  694.  
  695. This uses 16 as the Max pattern size.  Notice on the third line of the 
  696. output (the first line with level changes), the pattern is "7Z ... &{:".
  697. When we go from level 0 to level 2, we lose two characters (i.e., ":.").
  698. When we go from level 2 back to level 0, we insert two new characters 
  699. (i.e., "05" after the "osw5").
  700.  
  701. Any questions?  Or better yet, what did I leave out??  I do hope this helps 
  702. someone!?!
  703.  
  704.  
  705. -----------------------------------------------------------------------
  706. ----- C CODE TO GENERATE TEXT STEREOGRAMS -----------------------------
  707. -----------------------------------------------------------------------
  708.  
  709. Also from Dave Thomas:
  710.  
  711. Now here's a hack of a hack I found on the net.  Basically it generates
  712. stereograms from ascii diagrams.  Here's the program first (it uses the
  713. lookback algorithm, not the stored-pattern algorithm described above):
  714.  
  715. ##define DEPTH0  16
  716. ##define COLS    79
  717.  
  718. ##include <stdio.h>
  719.  
  720. main()
  721.    {
  722.    long now;
  723.    int col;
  724.    char m[COLS+1],s[COLS+1];
  725.    int i,e,c;
  726.  
  727.    /* seed random number generator */
  728.    time (&now);
  729.    srand (now);
  730.  
  731.    /* print fusion X's */
  732.    for (col = 0; COLS - col >= DEPTH0; col += DEPTH0)
  733.       {
  734.       for (i = 0; i < DEPTH0-1; ++i)
  735.          putchar (' ');
  736.       putchar ('X');
  737.       }
  738.    putchar ('\n');
  739.  
  740.    /* process input image */
  741.    while (memset(m,'\0',COLS+1),fgets (m, COLS+1, stdin))
  742.       {
  743.       e = 0;
  744.       s[COLS] = 0;
  745.       for(i=0; i<COLS; )
  746.          {
  747.          e = 0;
  748.          while (i >= DEPTH0 && i < COLS && 
  749.             (c = m[i - DEPTH0]) >= '0' && c <= '9')
  750.             {
  751.             e = 1;
  752.             s[i] = s[i-DEPTH0+c-'0'];
  753.             ++i;
  754.             }
  755.          s[i++] = (e || i < DEPTH0) ? randasc() : s[i-DEPTH0];
  756.          }
  757.       puts (s);
  758.       }
  759. }
  760.  
  761. randasc()
  762. {
  763.    /* large set of random characters */
  764.    return ('!'+rand()%92);
  765.  
  766.    /* lowercase random letters */
  767.    /* return ('a'+rand()%26); */
  768. }
  769.  
  770.  
  771. Try passing it this file as the standard input:
  772.                                 
  773.            22222222222222222           11111111111111111111111
  774.            2222222222222222222         11111111111111111111111
  775.            22222222222222222222        11111111111111111111111
  776.            22222          22222                 11111
  777.            22222          22222                 11111
  778.            22222          22222                 11111
  779.            22222          22222                 11111
  780.            22222          22222                 11111
  781.            22222          22222                 11111
  782.            22222222222222222222                 11111
  783.            2222222222222222222                  11111
  784.            22222222222222222                    11111
  785.                                                                         
  786.                                                                         
  787. You'll get output like this:
  788.  
  789.                X               X               X              X
  790. "i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D(v"i`<$$Co6&`R(D
  791. dZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,QFdZ<$wamwBy&>`,
  792. rHt&{:7Z,o:.sw5[rHt&{:7Z,osw5[rHt&{:7Z,osw505[rHt&{:7Zosw505[rHt&{:7Zosw505[rR
  793. 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
  794. {TAtrJyiQ?fiVF!G{TAtrJyiQ?VF!G{TAtrJyiQ?VF!G{T]TAtrJyi?VF!G{T]TAtrJyi?VF!G{T]s
  795. ##<sf!Q1`I|r?FLoB#<sf!Q1`I|FLoB#T#<sf!Q1`ILoB#TaT#<sf!Q1`ILoB#Ta#<sf!#Q1`ILoB#T
  796. \qy5:nm$LuSD0hh7\qy5:nm$Lu0hh7\x\qy5:nm$Lhh7\x"x\qy5:nm$Lhh7\x"\qy5:-nm$Lhh7\x
  797. /<bic$[#7hrqKUm`/<bic$[#7hKUm`/7/<bic$[#7Um`/7r7/<bic$[#7Um`/7r/<bick$[#7Um`/7
  798. 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|
  799. ;rmy9`3`#YPTdg:,;rmy9`3`#Ydg:,;(;rmy9`3`#g:,;(7(;rmy9`3`#g:,;(7;rmy94`3`#g:,;(
  800. 4U,yml1w^N7d;f964U,yml1w^N;f964&4U,yml1w^f964&;&4U,yml1w^f964&;4U,ym{l1w^f964&
  801. ?"A0+;<>Y8igID(]?"A0+;<>Y8ID(]?"A0+;<>Y8ID(]?"?"A0+;<>Y8ID(]?"?A0+;<O>Y8ID(]?"
  802. D0tscheRl5hfJx.cD0tscheRl5Jx.cD0tscheRl5Jx.cDeD0tscheRl5Jx.cDeDtscheiRl5Jx.cDe
  803. -AaV^hv,r7f6%<)R-AaV^hv,r7%<)R-AaV^hv,r7%<)p)R-AaV^hv,r7%<)p)R-aV^hv>,r7%<)p)R
  804. IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]qi(IRW)ytVbWqd^]q
  805. BX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=[gBX(Aqq`^Y-z8v=
  806.  
  807.  
  808.  
  809. -----------------------------------------------------------------------
  810. ----- HOPE FOR THE HOPELESS :-) ---------------------------------------
  811. -----------------------------------------------------------------------
  812.  
  813. From: wchaga@vela.acs.oakland.edu (William C. Haga)
  814.  
  815. Being one who has used wide-eyed vision on chain link fences ever
  816. since I was a kid, I was able to see the images in SIRDS right
  817. away. But I've had difficulty explaining the technique to friends. 
  818. Today I had the latest Games magazine with me at my parents house. 
  819. Games is running another contest using SIRDS, so there are three in 
  820. the latest issue. This time I thought of the reflection idea. So I 
  821. opened mom's china cabinet, put the magazine against the glass in 
  822. the door, and told mom to keep looking at her own reflection in the 
  823. glass until the image appeared.
  824.  
  825. It took less than thirty seconds.
  826.  
  827. When she saw the 3d train engines, I was subjected to a squeal of
  828. delight that I hadn't heard from her for a long time. "EEK! IT'S
  829. COMING OUT AT ME! IS THIS EVER NEAT!".  Dad tried for about a minute
  830. but gave up.
  831.  
  832. About an hour later, mom and I heard a shout. We went to
  833. the dining area, and there was dad with the magazine against the
  834. glass in the door. "Isn't that just the most amazing thing!", said he.
  835.  
  836. Later they were making jokes about teaching old dogs new tricks.
  837.  
  838.  
  839. -----------------------------------------------------------------------
  840. ----- COMMERCIAL Stereogram Producers --------------------------------------
  841. -----------------------------------------------------------------------
  842.  
  843. Infix Technologies
  844. PO Box 381
  845. Orem, UT 84057-0381
  846. (801) 221-9233
  847. contact: John M. Olsen, jolsen@nyx.cs.du.edu
  848. 18x24 Earth (mercator projection of the Earth's altitudes)
  849. 18x24 Salt Lake LDS Temple Centennial
  850. 18x24 Beethoven (300 DPI!  Very smooth.)
  851. (others are coming soon, too.)
  852. Retail price for the 18x24 inch prints is $20 plus $3 s/h.  Utah residents
  853. add 6.25% sales tax.  Wholesale and distributor discounts are available.
  854. Quotes for custom work are also available.  Cost and minimum order varies, 
  855. based on content.
  856.  
  857. Altered States
  858. 92 Turnmill St,
  859. Farringdon,
  860. London, EC1, U.K.
  861. +44 (0)71 490 2342
  862. Paul Dale (P.A.Dale@bath.ac.uk)
  863. tel: +44 (0)225 826 215
  864.  
  865. Send a catolog request to:
  866. N.E. Thing Enterprises
  867. 19C Crosby Drive
  868. Bedford, MA 01730
  869. >Info from: Neal T. Leverenz (at802@yfn.ysu.edu)
  870.  
  871. Inner Dynamics, Inc.
  872. The distributor: Privileged Traveler
  873.                  4914 Brook Road
  874.                  Lancaster, OH 43130
  875.                  (614) 756-7406
  876. Retail prices stated below plus $3 S&H. Ohio residents add 5.5% sales tax.
  877. GLOW IN The DARK Poster Series - $23  (size: 18" X 24")
  878.   "Knight Vision" - suspended chess board with chess pieces
  879.   above the board in daylight viewing - also an area in the center that has
  880.   a Knight chess piece - random dot pattern glows and is viewable in the dark!!
  881. Premium Color Series - $16  (size: 18" X 24")
  882.   "Gecko" - twin Gecko lizards
  883.   "I Think Therefore I Am" - well known quote surrounded by stunning visuals
  884.   "SoulMate" - hearts, spirals, and other symbols, for that special person
  885.   "The Mighty Unicorn" - unicorn, mystical castle, wizard, and flying dragon
  886.   "Excalibur" - legendary sword in the stone, castle, knights, etc.
  887.   "Where's Wilbur?" - can you find him in the forrest?
  888. Optimum Series - $15  (size: 24" X 36", black and white)
  889.   "Beyond Reality" - hearts, spirals, other cool shapes - extremely detailed
  890.   "20/20 Third Sight" - an eye chart done in 3D
  891.   "Illusions" - a labyrinth, try to find your way out!
  892.   "Meditation" - contains an ancient mandala, a real stress buster
  893.   "DreamWeaver" - unusual geometric shapes, helps induce lucid dreaming and 
  894.      dream remembrance
  895.   "Icons" - the five symbols of life
  896.   "Rainbows" - see color on a black and white poster (Not a 3D poster)
  897. >Sam Weaver (sew@cblpd.att.com)
  898.  
  899.  
  900.                                               *
  901. Todd D. Hale                          * * * * 
  902. thale@novell.com                      * *
  903. halet@bert.cs.byu.edu