home *** CD-ROM | disk | FTP | other *** search
/ Vrtulník 1 / Vrtulnik.bin / grafika / prog / rd3d / rd3d.doc < prev    next >
Encoding:
Text File  |  1994-01-13  |  14.7 KB  |  342 lines

  1.  
  2.                      ======================================
  3.                        3D RANDOM DOT PLOTTER, VERSION 1.0
  4.                                  Online Manual
  5.                      ======================================
  6.  
  7.  
  8.        DISCLAIMER
  9.  
  10.        What you are about to read was generated completely by me, Derry
  11.        Bryson, very late at night and may contain few, if any, actual
  12.        facts or useful information.  No claim is made to the
  13.        truthfulness or quality of the information contained.  Use at
  14.        your own risk!
  15.  
  16.  
  17.        WHAT IS A RANDOM DOT STEREOGRAM?
  18.  
  19.        A random dot stereogram, as the name suggests, is a stereogram
  20.        composed of random dots of color.  In general, a stereogram
  21.        consists of two images (one for each eye) designed to viewed in
  22.        such a way as to create a three-dimensional (3D) image.
  23.  
  24.        A common example of stereograms are the discs used with the
  25.        View-Master (at least they used to be common).  In the case of
  26.        View-Master, two pictures of each scene were taken (each shot
  27.        from a slightly different position and angle) and placed on
  28.        opposite sides of the disc.  When viewed through the
  29.        View-Master, each eye views a different image and your brain
  30.        puts them together to form one apparently solid (3D) image.
  31.  
  32.        In a random dot stereogram both images are combined into one
  33.        seemingly random field of dots.  In reality, the stereogram
  34.        consists of series of interleaved strips of dots.  Each strip is
  35.        a portion of the image for one eye.  These strips alternate in
  36.        the stereogram from left to right, one for the left eye, one for
  37.        the right eye, one for the left eye, and so on.  To view the
  38.        stereogram in 3D you must focus your eyes behind the stereogram
  39.        at the distance at which the strips overlap, your mind then
  40.        magically perceives a pattern in the dots and combines the two
  41.        images to form a solid 3D scene.
  42.  
  43.        There are other techniques, which I don't yet understand, that
  44.        appear to be variations on random dot stereograms but don't seem
  45.        quite as random.  If you have any information on how these are
  46.        generated, please let me know so I can incorporate them into the
  47.        program as well.
  48.  
  49.  
  50.        WHAT THE 3D RANDOM DOT PLOTTER DOES
  51.  
  52.        The 3D Random Dot Plotter (RD3D) takes a standard 256 color PCX
  53.        graphics file (or a RAW file, described below) and generates a
  54.        random dot stereogram from it that can be viewed on the computer
  55.        screen or dumped out on a printer.
  56.  
  57.        The PCX file is not used as an image in its normal form, but
  58.        rather the color of each pixel in the image indicates the depth
  59.        at the given X and Y position in the scene to be depicted.
  60.        Color 0 is the depth farthest from the viewer and color 255 the
  61.        nearest.
  62.  
  63.        These files can be created with any program that can generate 256
  64.        color PCX files.  The actual color of each pixel (as seen on the
  65.        screen) is unimportant, only the value (depth) of the color.
  66.  
  67.  
  68.        USING THE PROGRAM
  69.  
  70.        Use of the program is pretty straight forward; you will be
  71.        prompted for the file to be plotted, how to plot the image, and
  72.        where to display it (screen or printer).
  73.  
  74.        Each prompt is described in the order in which it will be
  75.        encountered below:
  76.  
  77.        File to plot:
  78.  
  79.                You may type in the name of the specific name of a PCX
  80.                (or RAW) file to be plotted or you may enter a wildcard
  81.                pattern and the program will allow you to select from a
  82.                list of files matching the pattern.
  83.  
  84.                For example you might enter *.PCX to select from all PCX
  85.                files.
  86.  
  87.                NOTE:  If you select a PCX format file, the file will be
  88.                converted into RAW format and placed in a temporary file
  89.                called TEMP.RAW which is removed when you exit the
  90.                program.  You will see a window appear indicating the
  91.                progress of the conversion.  It may take a little time
  92.                depending on the size of the PCX file, but it will not be
  93.                converted again as long as you are viewing the same PCX
  94.                file.  You should not name any RAW file you might create
  95.                or obtain TEMP.RAW as it will be overwritten.
  96.  
  97.        Pattern width (0-8000):
  98.  
  99.                This is the width of the strips used to create the
  100.                stereogram, as described above.
  101.  
  102.                The pattern width determines both the distance behind
  103.                the image your eyes will have to focus to and the
  104.                maximum depth in the image (the maximum depth cannot
  105.                exceed the pattern width).  The program will enter a
  106.                hopefully useful value if you enter a 0 for the pattern
  107.                width.
  108.  
  109.                In general, a value from 1/5 to 1/8 the width of the
  110.                image width works well; however, this may end up being
  111.                either too narrow or too wide for your eyes to easily
  112.                focus on (especially on printed stereograms).
  113.                Experimentation is what this program is good at, so try
  114.                different values until you find one that works for a
  115.                given image.
  116.  
  117.        Maximum elevation (0-8000):
  118.  
  119.                This is the maximum number of depth levels in the
  120.                stereogram and it cannot exceed the pattern width.  Lower
  121.                values (between 10 and 50) seem to work best as most
  122.                people can't seem to see the different depth levels
  123.                anyway.  Values close to the pattern width usually cause
  124.                a smearing effect across the image that can be very
  125.                distracting and cause problems when viewing.
  126.  
  127.        Maximum colors (2-256):
  128.  
  129.                This the the number of colors that will be used when
  130.                generating the image.  Color doesn't seem to add much
  131.                much to the effect, but it looks pretty.
  132.  
  133.        Random number gen seed:
  134.  
  135.                This is the seed value for the random number generater.
  136.                Because computers cannot really generate random numbers,
  137.                but rather generate a seemingly random series of numbers
  138.                we can set the starting point in this "random" series.
  139.                Hence we generate the same "random" dot pattern over and
  140.                over by using the same seed, or use a different seed to
  141.                generate a different "random" pattern.
  142.  
  143.                This can be very useful because one "random" pattern may
  144.                work well with a given stereogram, while another may not.
  145.                If the image appears muddled, you may try different
  146.                values for this field.
  147.  
  148.                Setting this to 0 will cause the program to load the seed
  149.                from the computer's clock which should give a fairly
  150.                random starting point.
  151.  
  152.        Once the values above are entered, you will be presented with a
  153.        menu allowing selection of the device on which to display the
  154.        image.  Use the cursor keys to move up and down the menu items
  155.        and press ENTER to select a device.  Once a device is selected,
  156.        another menu will appear allowing you to select the resolution
  157.        to use.
  158.  
  159.        If you select a printer as the output device (registered version
  160.        only), you will be presented with a menu allowing you to select
  161.        either LPT1 or LPT2.  Select the correct printer port for the
  162.        selected printer. Next, select either portrait or landscape
  163.        mode.
  164.  
  165.        Once you have selected a device for display, the image will be
  166.        plotted.
  167.  
  168.        If viewing on the computer screen, once the image is complete
  169.        the computer will beep.  Press any key to erase the image and
  170.        continue with another plot.
  171.  
  172.        If printing the image, you may press ESC to abort any time while
  173.        plotting or printing.  WARNING:  printing a large image can take
  174.        a few minutes and consume quite a bit of disk space.
  175.  
  176.  
  177.        VIEWING A RANDOM DOT STEREOGRAM
  178.  
  179.        The general idea is to stare at the stereogram and force your
  180.        eyes to focus behind the stereogram until the image appears.
  181.  
  182.        When doing this, double images will appear until your brain locks
  183.        in on the image.
  184.  
  185.        You might want to practice doing this with your eyes a bit to get
  186.        a feel for how to control your eyes in this way.
  187.  
  188.        The stereograms produced by this program each have two boxes
  189.        along the top of the image.  These are placed in the center of
  190.        the image exactly pattern width apart (or the width of the strips
  191.        in the stereogram apart).  These can be used to help focus your
  192.        eyes at the correct distance.  What you want to do is adjust your
  193.        focus until you see three boxes (the center dot will be two boxes
  194.        overlapping).  When you can see three boxes, concentrate on
  195.        holding the image of the three boxes steady.  Once this is
  196.        pretty stable shift your view down to the rest of the image,
  197.        concentrating on keeping it in focus.
  198.  
  199.        If the boxes are too far apart or too close together you will
  200.        have a difficult time bringing the image into focus.  Try to
  201.        select pattern width values which position the boxes about 2
  202.        inches apart.
  203.  
  204.        You might want to practice shifting focus from your normal focus
  205.        (two boxes) to the point where you see three boxes until you can
  206.        do it without much thought.
  207.  
  208.        Many people find it easier to relax their eyes as one might do
  209.        when day dreaming or thinking intensly about something to shift
  210.        their focus.
  211.  
  212.        It may be difficult at first (and really difficult if you make
  213.        the pattern width too wide or too narrow), but once you learn to
  214.        do it you won't need the alignment boxes anymore.  In fact, you
  215.        will be able to view other things as stereograms.  Computer
  216.        keyboards are good subjects for viewing, just shift your focus in
  217.        the same way as for the stereogram until the double image of the
  218.        keys overlaps.  Does it look more 3D when viewed as stereogram?
  219.  
  220.  
  221.        EXAMPLE PCX FILES
  222.  
  223.        Several example PCX files are included for you to view.  They are
  224.        listed below with example viewing parameters.
  225.  
  226.            CONES.PCX       (800 x 600)
  227.  
  228.                Pattern width           -> 0 (let program make it up)
  229.                Maximum elevation       -> 0 (let program make it up)
  230.                Maximum colors          -> 256
  231.                Random number gen seed  -> 0
  232.  
  233.                Select SVGA256 and 800x600 resolution.
  234.  
  235.  
  236.            TREX.PCX        (320x200)
  237.  
  238.                Pattern width           -> 40
  239.                Maximum elevation       -> 40
  240.                Maximum colors          -> 256
  241.                Random number gen seed  -> 0
  242.  
  243.                Select SVGA256 and 320x200 resolution
  244.  
  245.  
  246.        CREATING YOUR OWN STEREOGRAMS
  247.  
  248.        Because the program can use standard 256 color PCX files, you can
  249.        create your own stereograms with almost any paint program or any
  250.        program that can generate 256 color PCX files.  Make sure that
  251.        you save the files in 256 color format, the program cannot
  252.        handle monochrome or 16 color format files.
  253.  
  254.        Start with simple shapes like rectangles and circles of
  255.        different colors.  Then move on to more complex shapes.
  256.  
  257.        The dinosaur example PCX file (TREX.PCX) was generated by
  258.        scanning an image from a coloring book into the computer in black
  259.        and white and then coloring the image in a paint program to
  260.        create the different depth levels.  (We actually faxed the
  261.        picture with a standard fax machine to a FAX/MODEM).
  262.  
  263.        For those with programming skills, you might try generating RAW
  264.        format files (see below) from mathematical formulas.
  265.  
  266.  
  267.  
  268.                          *** TECHNICAL INFORMATION ***
  269.  
  270.  
  271.        RAW FILE FORMAT
  272.  
  273.        The RAW file format is specific to this program (although its
  274.        pretty simple so others may inadvertantly be using it as well)
  275.        and is used to store a depth map from which to generate a
  276.        stereogram.
  277.  
  278.        This file format is used for two reasons:  1) in many PCX files,
  279.        the encoding continues beyond the end of a single line making it
  280.        difficult to read on a line by line basis, and 2) PCX files are
  281.        more difficult to generate.  This format should be selected if
  282.        you decide to write a program to generate a depth map for display
  283.        by this program.
  284.  
  285.        A RAW file consists of a short header which contains the width,
  286.        length, maximum elevation, and data size for the depth map.
  287.        Following the header is width * length * data size bytes which
  288.        make up the depth map.
  289.  
  290.        In C notation, the header is defined as follows:
  291.  
  292.                struct
  293.                {
  294.                  int
  295.                    Width,
  296.                    Length,
  297.                    DataSize,
  298.                    MaxElevation;
  299.                }
  300.  
  301.        At this time the DataSize must be either 1 or 2, indicating
  302.        either a 1 or 2 byte integer.  While a data size of 2 should
  303.        theoretically work, it has not been tested because depth values
  304.        beyond 256 don't seem useful (in fact depth values above 50
  305.        really don't either).
  306.  
  307.        MaxElevation SHOULD be set to the maximum value of the depth data
  308.        as it is used when scaling the depth values when plotting.
  309.  
  310.  
  311.        PROGRAM DETAILS
  312.  
  313.        This program is written entirely in C and compiled with the
  314.        Borland C++ V3.1 compiler.  All plotting to the screen and
  315.        printers is acomplished through the use of BGI drivers.
  316.  
  317.        The BGI printer drivers were obtained from Ryle Design, P.O. Box
  318.        22, Mt. Pleasant, MI, 48804, (517) 773-0587.
  319.  
  320.        The BGI graphics drivers for the 16 and 256 color SVGA modes are
  321.        from Jordan Hargrave, 1615 Burnley Road, Charlotte, NC, 28210,
  322.        (704) 553-2332.
  323.  
  324.        Just how did I get BGI to load 7 user drivers?  Hack, hack,
  325.        hack...
  326.  
  327.  
  328.  
  329.                                   BIBLIOGRAPY
  330.  
  331.        _Random Dot Stereograms_ by Andrew A. Kinsman.  Copyright 1992
  332.        by Andrew Kinsman.  Published by Kinsman Physics, P.O. Box
  333.        22682, Rochester, NY, 14692-2682 ($17pp).  ISBN 0-9630142-1-8
  334.  
  335.  
  336.  
  337.  
  338.            Copyright (c) 1994 by Derry Bryson.  All Rights Reserved.
  339.  
  340.        No part of this document may be reproduced in any form without
  341.        specific written permission of the author.
  342.