home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 156.lha / QuickRayTrace / Doc / Language.doc < prev    next >
Encoding:
Text File  |  1988-04-27  |  35.2 KB  |  1,453 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.         
  8.         
  9.         
  10.                              QRT Language Reference
  11.         
  12.         
  13.         INTRODUCTION
  14.         
  15.         This document is a reference  guide  to the QRT command language.
  16.         One section is devoted to each  QRT  command.   All parameters to
  17.         commands are listed.
  18.         
  19.         More information on QRT can  be  found  in  the User's Manual and
  20.         Technical Reference Manual.
  21.         
  22.         
  23.         The following table lists syntax used in this document:
  24.         
  25.             TEXT       MEANING              EXAMPLE             RANGE
  26.         
  27.             (x,y,z)    floating pt vector   (10, -20, 30.56)    all
  28.         
  29.             (r,g,b)    color value triple   (0, .5, 1.00)       0 to 1
  30.         
  31.             i          an integer           12                  0 to 127
  32.         
  33.             n          floating pt number   -123.4              all
  34.         
  35.             p          positive float       123.4               >0
  36.         
  37.             string     text string          FOO_BAR             ASCII
  38.         
  39.         
  40.         Each  section  of  this  document  contains  one  or  more of the
  41.         following sub-sections:
  42.         
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.         QRT Ray Tracer               Page 1            Language Reference
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.         
  74.           Command Type          :  OPTIONAL or REQUIRED
  75.         
  76.           Parameters (required) :  Lists required parameters
  77.           Parameters (optional) :  Lists optional parameters
  78.         
  79.           Optional Forms        :  Alternatives for parameter names. Ex:
  80.                                    'horiz' = 'horizon' means either can
  81.                                    be used as a parameter name.
  82.         
  83.           Example               :  An example of the command (with all
  84.                                    required parameters, but not
  85.                                    necessarily all optional ones.
  86.         
  87.           Restrictions          :  Things not to do
  88.         
  89.           See also              :  Similar commands
  90.         
  91.         
  92.         QRT has a free format input language, and parameters can be given
  93.         in any order.
  94.         
  95.         
  96.         
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.         QRT Ray Tracer               Page 2            Language Reference
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.         
  140.                             QRT Misc. Setup Commands
  141.         
  142.         
  143.         SKY:
  144.            
  145.            Command type: OPTIONAL
  146.            
  147.            The SKY command is used to specify  the color of all rays that
  148.            don't hit any other object.  The sky is black by default.  The
  149.            sky color at the zenith (up),  and  horizon  can be specified,
  150.            and QRT will  blend  the  colors  in  between  as  smoothly as
  151.            possible.  In addition, dithering can be specified.
  152.            
  153.            Parameters (optional):
  154.            
  155.                zenith = (r,g,b)        : the color of the zenith
  156.                horiz  = (r,g,b)        : the color at the horizon
  157.                dither = i              : dithering
  158.            
  159.            Optional forms:
  160.            
  161.                'horiz' = 'horizon'
  162.            
  163.            Example:
  164.            
  165.                SKY (  horiz  = (0, 0, .6),
  166.                       zenith = (0, 0, .4),
  167.                       dither = 5
  168.                    )
  169.            
  170.            See also : GROUND
  171.            
  172.            
  173.         GROUND:
  174.         
  175.            Command type: OPTIONAL
  176.            
  177.            QRT does not have a specific  ground  command.  Instead, use a
  178.            large parallelogram with an optional pattern.
  179.            
  180.                PARALLELOGRAM (  loc = (-10000, 0, -10000),
  181.                                  v1  = ( 20000, 0,      0),
  182.                                  v2  = ( 0,     0,  20000),
  183.            
  184.                                  pattern = PATTERN_OF_CHOICE
  185.                               )
  186.            
  187.            See also : PARALLELOGRAM
  188.            
  189.  
  190.  
  191.  
  192.         QRT Ray Tracer               Page 3            Language Reference
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.         FOC_LENGTH:
  206.            
  207.            Command type: OPTIONAL
  208.            
  209.            This sets the focal length of QRT's  "camera".  The default is
  210.            50, but it can be  changed  with  this  command.  As with 35mm
  211.            photography, larger numbers  result  in  a 'telephoto' effect,
  212.            and smaller numbers will result  in wide angle (and distorted)
  213.            views.
  214.            
  215.            Example:
  216.            
  217.                FOC_LENGTH = 70
  218.            
  219.            Restrictions:
  220.            
  221.                0 < FOC_LENGTH
  222.            
  223.            
  224.         FIRST_SCAN:
  225.            
  226.            Command type: OPTIONAL
  227.            
  228.            By default, QRT generates an image with the same resolution as
  229.            your screen.   However,  it  can  be  instructed  to  create a
  230.            partial image  by  using  this  command  and  LAST_SCAN.  This
  231.            feature may  not  be  supported,  depending  on  your QRT post
  232.            processor.  First scan should be less than the Y resolution of
  233.            your screen.
  234.            
  235.            Example:
  236.            
  237.                FIRST_SCAN = 100
  238.            
  239.            Restrictions:
  240.            
  241.                0 < FIRST_SCAN < y-resolution
  242.            
  243.            See also : LAST_SCAN
  244.            
  245.            
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.         QRT Ray Tracer               Page 4            Language Reference
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.            
  272.         LAST_SCAN:
  273.            
  274.            Command type: OPTIONAL
  275.            
  276.            This command is similar  to  FIRST_SCAN.  LAST_SCAN  should be
  277.            less than the Y resolution of your screen.
  278.            
  279.            Example:
  280.            
  281.                LAST_SCAN = 300
  282.            
  283.            Restrictions:
  284.            
  285.                0 < LAST_SCAN < y-resolution
  286.            
  287.            See also : FIRST_SCAN
  288.            
  289.            
  290.         FILE_NAME:
  291.            
  292.            Command type: REQUIRED
  293.            
  294.            This is used to set  the  output  file  for QRT, which will be
  295.            read by the post processor.  The  file  name will be mapped to
  296.            upper case.   Some  restrictions  may   arise from file naming
  297.            conventions on specific computers.
  298.            
  299.                Example:
  300.            
  301.                    FILE_NAME = QRT_IMAGE.RAW
  302.            
  303.            
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.         QRT Ray Tracer               Page 5            Language Reference
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.            
  338.         OBSERVER:
  339.            
  340.            Command type: REQUIRED
  341.            
  342.            OBSERVER tells QRT where  the  observer  is  located,  and his
  343.            direction of view.  The view direction  is specified by giving
  344.            the coordinates he should look at.   In addition, the observer
  345.            UP vector may be given.  This is, by default, (0,1,0).
  346.            
  347.            Parameters (required):
  348.            
  349.                loc     = (x,y,z)           : location of observer
  350.                lookat  = (x,y,z)           : point of interest
  351.            
  352.            Parameters (optional):
  353.            
  354.                up      = (x,y,z)           : up vector
  355.            
  356.            Optional forms:
  357.            
  358.                'loc' = 'pos' = 'location' = 'position'
  359.            
  360.            Example:
  361.            
  362.                OBSERVER ( loc    = (0, 0, 0),
  363.                           lookat = (100, 0, 0)
  364.                         )
  365.            
  366.            Restrictions:
  367.            
  368.                The observer cannot  look  in  the  direction  of  the  up
  369.            vector.
  370.                'lookat' cannot be equal to 'loc'.
  371.                'up' must have non-zero length.
  372.            
  373.            
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.         QRT Ray Tracer               Page 6            Language Reference
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.            
  404.         LAMP:
  405.            
  406.            Command type: OPTIONAL
  407.            
  408.            Lamps are  sources  of  light  in  QRT.   They  can  be placed
  409.            anywhere, and emit any  color  and  intensity  of  light.  The
  410.            ambient light value is the  color  of  the lamp.  The distance
  411.            parameter is the minimum  distance  from the lamp that objects
  412.            will be illuminated at full intensity.  Most objects should be
  413.            farther from the lamp than  this  value,  or else they will be
  414.            washed out.  The radius parameter  is ignored by this  version
  415.            of QRT, but may  eventually  be  used  to  implement penumbral
  416.            shadows.
  417.            
  418.            Parameters (required):
  419.            
  420.                loc     = (x,y,z)           : location of object
  421.                dist    = p                 : distance of max illumination
  422.            
  423.            Parameters (optional):
  424.            
  425.                amb     = (r,g,b)           : ambient light
  426.                radius  = p                 : radius
  427.            
  428.            
  429.            Optional forms:
  430.            
  431.                'loc' = 'pos' = 'location' = 'position'
  432.            
  433.            Example:
  434.            
  435.                LAMP (     loc    = (12,34,56),
  436.                           radius = 123.4,
  437.                     )
  438.            
  439.            
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.         QRT Ray Tracer               Page 7            Language Reference
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.            
  470.                                QRT Primitive Types
  471.         
  472.         
  473.         SPHERE:
  474.            
  475.            Command type: OPTIONAL
  476.            
  477.            SPHERE creates a sphere  with  a  given  location, radius, and
  478.            surface characteristics.
  479.            
  480.            Parameters (required):
  481.            
  482.                loc     = (x,y,z)           : location of object
  483.                radius  = p                 : radius
  484.            
  485.            Parameters (optional):
  486.            
  487.                name    = string            : name for object
  488.                pattern = string            : pattern name to attach
  489.                amb     = (r,g,b)           : ambient light
  490.                diff    = (r,g,b)           : diffuse reflection
  491.                trans   = (r,g,b)           : transmission
  492.                mirror  = (r,g,b)           : mirror reflection
  493.                fuzz    = i                 : currently unused
  494.                index   = p                 : index of refraction
  495.                dither  = i                 : dithering
  496.                sreflect= p                 : Phong specular refl. coeff.
  497.                reflect = p                 : percent specular reflection
  498.            
  499.            Optional forms:
  500.            
  501.                'loc' = 'pos' = 'location' = 'position'
  502.            
  503.            Example:
  504.            
  505.                SPHERE   ( loc    = (100, 100, 50.234),
  506.                           radius = 123.4,
  507.                           diff   = (1.00, .20, .20)
  508.                         )
  509.            
  510.            
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.         QRT Ray Tracer               Page 8            Language Reference
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.            
  536.         PARALLELOGRAM:
  537.            
  538.            Command type: OPTIONAL
  539.            
  540.            This command creates a  parallelogram  with  a given location,
  541.            shape, and surface  characteristics.   Two  vectors define the
  542.            shape of the parallelogram (they need not be orthogonal).
  543.            
  544.            Parameters (required):
  545.            
  546.                loc     = (x,y,z)           : location of object
  547.                v1      = (x,y,z)           : vector for side one
  548.                v2      = (x,y,z)           : vector for side two
  549.            
  550.            Parameters (optional):
  551.            
  552.                name    = string            : name for object
  553.                pattern = string            : pattern name to attach
  554.                amb     = (r,g,b)           : ambient light
  555.                diff    = (r,g,b)           : diffuse reflection
  556.                trans   = (r,g,b)           : transmission
  557.                mirror  = (r,g,b)           : mirror reflection
  558.                fuzz    = i                 : currently unused
  559.                index   = p                 : index of refraction
  560.                dither  = i                 : dithering
  561.                sreflect= p                 : Phong specular refl. coeff.
  562.                reflect = p                 : percent specular reflection
  563.            
  564.            Optional forms:
  565.            
  566.                'loc' = 'pos' = 'location' = 'position'
  567.                'vect1' = 'v1'
  568.                'vect2' = 'v2'
  569.            
  570.            Example:
  571.            
  572.                PARALLELOGRAM ( loc    = (10, 20, 50),
  573.                                vect1  = (20,  0,  0),
  574.                                vect2  = ( 0,  0,  50),
  575.                                diff   = (0, .90, .20)
  576.                              )
  577.            
  578.            
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.         QRT Ray Tracer               Page 9            Language Reference
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.            
  602.         TRIANGLE:
  603.            
  604.            Command type: OPTIONAL
  605.            
  606.            The TRIANGLE  command  (similar  to  PARALLELOGRAM)  creates a
  607.            triangle shape.  Two vectors define the sides of the triangle.
  608.            
  609.            Parameters (required):
  610.            
  611.                loc     = (x,y,z)           : location of object
  612.                v1      = (x,y,z)           : vector for side one
  613.                v2      = (x,y,z)           : vector for side two
  614.            
  615.            Parameters (optional):
  616.            
  617.                name    = string            : name for object
  618.                pattern = string            : pattern name to attach
  619.                amb     = (r,g,b)           : ambient light
  620.                diff    = (r,g,b)           : diffuse reflection
  621.                trans   = (r,g,b)           : transmission
  622.                mirror  = (r,g,b)           : mirror reflection
  623.                fuzz    = i                 : currently unused
  624.                index   = p                 : index of refraction
  625.                dither  = i                 : dithering
  626.                sreflect= p                 : Phong specular refl. coeff.
  627.                reflect = p                 : percent specular reflection
  628.            
  629.            
  630.            Optional forms:
  631.            
  632.                'loc' = 'pos' = 'location' = 'position'
  633.                'vect1' = 'v1'
  634.                'vect2' = 'v2'
  635.            
  636.            Example:
  637.            
  638.                TRIANGLE      ( loc    = (52, 21, 50),
  639.                                vect1  = (10,  5,  0),
  640.                                vect2  = ( 0,  8, 20),
  641.                                diff   = ( 0,  0,  0),
  642.                                mirror = ( 1,  1,  1)
  643.                              );
  644.            
  645.            
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.         QRT Ray Tracer               Page 10           Language Reference
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.            
  668.         RING:
  669.         
  670.         Command type: OPTIONAL
  671.         
  672.         RING creates a ring (annulus), which  is a circle with a  smaller
  673.         circle cut out of it.  If  the  innder  radius  is zero, the ring
  674.         will be a simple circle.  Two  vectors   define  the plane of the
  675.         annulus, as with RING and PARALLELOGRAM.
  676.         
  677.         Parameters (required):
  678.         
  679.             loc     = (x,y,z)           : location of object
  680.             v1      = (x,y,z)           : vector one
  681.             v2      = (x,y,z)           : vector two
  682.             rad_1   = p                 : inner radius
  683.             rad_2   = p                 : outer radius
  684.         
  685.         Parameters (optional):
  686.         
  687.             name    = string            : name for object
  688.             pattern = string            : pattern name to attach
  689.             amb     = (r,g,b)           : ambient light
  690.             diff    = (r,g,b)           : diffuse reflection
  691.             trans   = (r,g,b)           : transmission
  692.             mirror  = (r,g,b)           : mirror reflection
  693.             fuzz    = i                 : currently unused
  694.             index   = p                 : index of refraction
  695.             dither  = i                 : dithering
  696.             sreflect= p                 : Phong specular refl. coeff.
  697.             reflect = p                 : percent specular reflection
  698.         
  699.         Optional forms:
  700.         
  701.             'loc' = 'pos' = 'location' = 'position'
  702.             'vect1' = 'v1'
  703.             'vect2' = 'v2'
  704.         
  705.         Example:
  706.         
  707.             RING      ( loc    = (52, 21, 50),
  708.                         v1     = (10,  5,  0),
  709.                         v2     = ( 0,  8, 20),
  710.                         rad_1  = 10,
  711.                         rad_2  = 20,
  712.                       )
  713.         
  714.         Restrictions:
  715.         
  716.             0 < rad_1 < rad_2
  717.  
  718.  
  719.  
  720.         QRT Ray Tracer               Page 11           Language Reference
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.         
  734.         QUADRATIC:
  735.            
  736.            Command type: OPTIONAL
  737.            
  738.            This  command  creates  a  quadratic   surface  given  by  the
  739.            equation:
  740.            
  741.                     2     2     2
  742.                  a x + b y + c z  = d
  743.            
  744.            The coefficients a,b,c and d can be specified.  This primitive
  745.            can be used to  create  cylinders,  cones,  oblong  spheroids,
  746.            etc.  Several min  and  max  parameters  specify  the  maximum
  747.            extents of the surface.
  748.            
  749.            Parameters (required):
  750.            
  751.                loc     = (x,y,z)           : location of object
  752.                a       = n
  753.                b       = n
  754.                c       = n
  755.                d       = n
  756.                xmax    = n
  757.                xmin    = n
  758.                ymax    = n
  759.                ymin    = n
  760.                zmax    = n
  761.                zmin    = n
  762.            
  763.            Parameters (optional):
  764.            
  765.                name    = string            : name for object
  766.                pattern = string            : pattern name to attach
  767.                amb     = (r,g,b)           : ambient light
  768.                diff    = (r,g,b)           : diffuse reflection
  769.                trans   = (r,g,b)           : transmission
  770.                mirror  = (r,g,b)           : mirror reflection
  771.                fuzz    = i                 : currently unused
  772.                index   = p                 : index of refraction
  773.                dither  = i                 : dithering
  774.                sreflect= p                 : Phong specular refl. coeff.
  775.                reflect = p                 : percent specular reflection
  776.            
  777.            
  778.            Optional forms:
  779.            
  780.                'loc' = 'pos' = 'location' = 'position'
  781.            
  782.  
  783.  
  784.  
  785.  
  786.         QRT Ray Tracer               Page 12           Language Reference
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.            
  800.            Example:
  801.            
  802.                { ** vertical cylinder ** }
  803.            
  804.                QUADRATIC   ( loc    = (57, 21.2, 0),
  805.                                a    = 1,
  806.                                b    = 0,
  807.                                c    = 1,
  808.                                d    = 100
  809.                            );
  810.            
  811.            Restrictions:
  812.            
  813.                a != 0 or b != 0 or c != 0
  814.            
  815.            
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.         QRT Ray Tracer               Page 13           Language Reference
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.            
  866.            
  867.                                Patterned Surfaces
  868.         
  869.         
  870.         PATTERN:
  871.            
  872.            Command type: OPTIONAL
  873.            
  874.            This  command  creates  a  pattern  definition  which  can  be
  875.            attached  to  any  primitive  object.   A  pattern  is  a  two
  876.            dimensional array than can  be  mapped  to  the surface of any
  877.            primitive.  Patterns must be defined before they are used. The
  878.            PATTERN keyword serves  two  functions:  to  create  a pattern
  879.            definition, and to attach this definition  to a primitive. The
  880.            correct meaning is found by  context:   if the PATTERN keyword
  881.            appears in a primitive  definition  followed  by a name, it is
  882.            assumed to refer to a predefined  pattern. However, if PATTERN
  883.            occurs outside any primitive definition, it is assumed to be a
  884.            pattern  definition.   If  all  the  pattern  definitions  are
  885.            grouped at the top of the  file,  they  will always be defined
  886.            before they are used.
  887.             
  888.            A pattern is defined by giving  it  a size, a name, and one or
  889.            more sub-pattern definitions.   There  are currently two types
  890.            of sub-patterns: CIRCLE and  RECTANGLE.   The sub-pattern list
  891.            can be of any length  (although  long  lists will slow the ray
  892.            tracer), and can  use  several  of  each  type  of sub-pattern
  893.            primitive.
  894.            
  895.            The X and Y size parameters  specify  the size of the pattern;
  896.            the pattern will be  repeated  over  the  surface of an object
  897.            each X or Y units in  the  indicated  direction.   These  size
  898.            units are arbitrary, since the pattern can be given a new size
  899.            when attached to an object.
  900.            
  901.            In each sub-pattern, any object surface characteristics can be
  902.            specified.  If a given ray hits  this sub-pattern, the surface
  903.            will be colored  as  indicated.   If  it  does not hit any sub
  904.            pattern   in   the   list,   the   objects   default   surface
  905.            characteristics will be  used.    The  example below defines a
  906.            red-checkered pattern.  The background  color of the object to
  907.            which this pattern is attached will determine the color of the
  908.            other checker box in the pattern.
  909.            
  910.            Parameters (required):
  911.            
  912.                name    = string            : name for pattern
  913.                x_size  = p                 : x size of pattern
  914.                y_size  = p                 : y size of pattern
  915.            
  916.  
  917.  
  918.         QRT Ray Tracer               Page 14           Language Reference
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.            Parameters (optional):
  932.            
  933.                CIRCLE  = circle_defn       : CIRCLE sub-pattern - see
  934.                                              reference for CIRCLE
  935.            
  936.                RECTANGLE = rect_defn       : RECTANGLE sub-pattern - see
  937.                                              reference for RECTANGLE
  938.            
  939.            Optional forms:
  940.            
  941.                'loc' = 'pos' = 'location' = 'position'
  942.            
  943.            Example:
  944.            
  945.                 PATTERN ( x_size = 16,
  946.                           y_size = 16,
  947.                           name   = CHECK,
  948.            
  949.                           RECTANGLE (
  950.                             start_x = 0, start_y = 0,
  951.                             end_x   = 8, end_y   = 8,
  952.                             diff    = (1.00, .20, .20);
  953.                           )
  954.            
  955.                           RECTANGLE (
  956.                             start_x = 8,  start_y = 8,
  957.                             end_x   = 16, end_y   = 16,
  958.                             diff    = (1.00, .20, .20);
  959.                           )
  960.                         )
  961.            
  962.                This pattern can now be attached to an object as follows:
  963.            
  964.                SPHERE ( { ** sphere definition here ** }
  965.                         pattern = CHECK,
  966.                         xmult   = .5,
  967.                         ymult   = .5
  968.                       )
  969.            
  970.                Where the xmult and ymult parameters specify a new size
  971.                for the pattern.
  972.            
  973.            Restrictions:
  974.            
  975.                At least one sub-pattern must appear.
  976.            
  977.                If two sub-patterns overlap in a region, the last one
  978.                   defined will be used in this region.
  979.            
  980.            See also : RECTANGLE, CIRCLE
  981.  
  982.  
  983.  
  984.         QRT Ray Tracer               Page 15           Language Reference
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.            
  998.         RECTANGLE:
  999.            
  1000.            Command type: OPTIONAL
  1001.            
  1002.            RECTANGLE is a type of sub-pattern.
  1003.            
  1004.            Parameters (required):
  1005.            
  1006.                start_x = p                 : start position for rectangle
  1007.                start_y = p
  1008.                end_x   = p                 : end position for rectangle
  1009.                end_y   = p
  1010.            
  1011.            Parameters (optional):
  1012.            
  1013.                amb     = (r,g,b)           : ambient light
  1014.                diff    = (r,g,b)           : diffuse reflection
  1015.                trans   = (r,g,b)           : transmission
  1016.                mirror  = (r,g,b)           : mirror reflection
  1017.                fuzz    = i                 : currently unused
  1018.                index   = p                 : index of refraction
  1019.                dither  = i                 : dithering
  1020.                sreflect= p                 : Phong specular refl. coeff.
  1021.                reflect = p                 : percent specular reflection
  1022.            
  1023.            Example:
  1024.            
  1025.                RECTANGLE (
  1026.                    start_x = 10, start_y = 12,
  1027.                    end_x   = 15, end_y   = 15,
  1028.            
  1029.                    diff    = (1.00, .20, .20);
  1030.                )
  1031.            
  1032.            Restrictions:
  1033.            
  1034.                RECTANGLE should be used only within a pattern definition.
  1035.                start_x < end_x
  1036.                start_y < end_y
  1037.            
  1038.            See also : PATTERN
  1039.            
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.         QRT Ray Tracer               Page 16           Language Reference
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.            
  1064.         CIRCLE:
  1065.            
  1066.            Command type: OPTIONAL
  1067.            
  1068.            CIRCLE is a type of sub-pattern.
  1069.            
  1070.            Parameters (required):
  1071.            
  1072.                radius  = p                 : radius
  1073.            
  1074.            Parameters (optional):
  1075.            
  1076.                amb     = (r,g,b)           : ambient light
  1077.                diff    = (r,g,b)           : diffuse reflection
  1078.                trans   = (r,g,b)           : transmission
  1079.                mirror  = (r,g,b)           : mirror reflection
  1080.                fuzz    = i                 : currently unused
  1081.                index   = p                 : index of refraction
  1082.                dither  = i                 : dithering
  1083.                sreflect= p                 : Phong specular refl. coeff.
  1084.                reflect = p                 : percent specular reflection
  1085.            
  1086.            Example:
  1087.            
  1088.                CIRCLE (
  1089.                  radius  = 5,
  1090.                  diff    = (1.00, .20, .20);
  1091.                )
  1092.            
  1093.            Restrictions:
  1094.            
  1095.                CIRCLE should be used only within a pattern definition.
  1096.            
  1097.            
  1098.            See also : PATTERN
  1099.            
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.         QRT Ray Tracer               Page 17           Language Reference
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.            
  1130.                                  Bounding Boxes
  1131.         
  1132.         
  1133.         BEGIN_BBOX:
  1134.            
  1135.            Command type: OPTIONAL
  1136.            
  1137.            The BEGIN_BBOX, END_BBOX  commands  form an enclosing bounding
  1138.            box around  a  group  of  objects  (which  may  include  other
  1139.            bounding boxes).  An optional  name  must precede the bounding
  1140.            box begin statement.  Bounding  boxes  cannot be given surface
  1141.            characteristics, since they are conceptual objects.
  1142.            
  1143.            Parameters (optional):
  1144.            
  1145.                name    = string            : name for box
  1146.            
  1147.            Example:
  1148.            
  1149.                name = SAMPLE_BBOX
  1150.                BEGIN_BBOX
  1151.                    SPHERE   ();            { ** sphere    here ** }
  1152.                    TRIANGLE ();            { ** triangle  here ** }
  1153.                END_BBOX
  1154.            
  1155.            Restrictions:
  1156.            
  1157.                Must be paired with an END_BBOX statement.
  1158.            
  1159.            
  1160.         END_BBOX:
  1161.            
  1162.            Command type: OPTIONAL
  1163.            
  1164.            Companion command to BEGIN_BBOX.
  1165.            
  1166.            Example:
  1167.            
  1168.                name = SAMPLE_BBOX
  1169.                BEGIN_BBOX
  1170.                    SPHERE   ();            { ** sphere    here ** }
  1171.                    TRIANGLE ();            { ** triangle  here ** }
  1172.                END_BBOX
  1173.            
  1174.            Restrictions:
  1175.            
  1176.                Must be paired with a BEGIN_BBOX statement.
  1177.            
  1178.            
  1179.  
  1180.  
  1181.  
  1182.         QRT Ray Tracer               Page 18           Language Reference
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.            
  1196.         
  1197.                                     Instances
  1198.         
  1199.         
  1200.         
  1201.         BEGIN_INSTANCES:
  1202.            
  1203.            Command type: OPTIONAL
  1204.            
  1205.            Several primitives may be grouped into an 'instance', and this
  1206.            group can easily be placed in several locations.  In addition,
  1207.            it can be resized.  All  instance  definitions  must be placed
  1208.            within the BEGIN_INSTANCES and END_INSTANCES  statements; only
  1209.            one set of these statements  is  allowed.   A group of objects
  1210.            must be placed in a BBOX, and this  BBOX must be given a name.
  1211.            In the following example, three objects are defined: OBJECT_1,
  1212.            SUB_OBJECT_1, and  OBJECT_2.  Any  inclusion  of OBJECT_1 will
  1213.            implicitly  include   SUB_OBJECT_1,  but  not  OBJECT_2.   Any
  1214.            arbitrary object tree can  be  included.  Referring  to a node
  1215.            will include the sub-tree rooted at that node.
  1216.            
  1217.            Example:
  1218.            
  1219.                BEGIN_INSTANCES
  1220.            
  1221.                    NAME = OBJECT_1
  1222.                    BEGIN_BBOX
  1223.            
  1224.                        { ** some primitives here ** }
  1225.                        NAME = SUB_OBJECT_1
  1226.                        BEGIN_BBOX
  1227.                          { ** some more primitives here ** }
  1228.                        END_BBOX
  1229.                    END_BBOX
  1230.            
  1231.                    NAME = OBJECT_2
  1232.                    BEGIN_BBOX
  1233.                        { ** more primitives ** }
  1234.                    END_BBOX
  1235.            
  1236.                END_INSTANCES
  1237.            
  1238.            Restrictions:
  1239.            
  1240.                There can be only one BEGIN_INSTANCES statement.
  1241.            
  1242.            See also: END_INSTANCES, INSTANCE_OF
  1243.            
  1244.            
  1245.  
  1246.  
  1247.  
  1248.         QRT Ray Tracer               Page 19           Language Reference
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.            
  1262.         END_INSTANCES:
  1263.            
  1264.            Command type : OPTIONAL
  1265.            
  1266.            This command specifies  the  end  of  the  instance tree.  Any
  1267.            primitive  after  the  END_INSTANCES  statement  are  actually
  1268.            displayed as part of the image.
  1269.            
  1270.            Restrictions:
  1271.            
  1272.                There can be only one END_INSTANCES statement.
  1273.            
  1274.                See also: BEGIN_INSTANCES, INSTANCE_OF
  1275.            
  1276.            
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.         QRT Ray Tracer               Page 20           Language Reference
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.            
  1328.         INSTANCE_OF:
  1329.            
  1330.            Command type: OPTIONAL
  1331.            
  1332.            After an instance tree is  defined  with  the BEGIN_INSTANCES,
  1333.            END_INSTANCES command pair, parts  of the tree can be referred
  1334.            to with the  INSTANCE_OF  statement.   This  actually puts the
  1335.            sub-tree in the image.  You must specify the name of the  root
  1336.            of the sub-tree.   The  original  instance  should  be defined
  1337.            relative to (0,0,0),  and  the  location  parameter  specifies
  1338.            where the new copy will go.
  1339.            
  1340.            Parameters (required):
  1341.            
  1342.                name    = string            : name of sub-tree
  1343.                loc     = (x,y,z)           : location for instance
  1344.            
  1345.            Parameters (optional):
  1346.            
  1347.                scale   = (x,y,z)           : scale factor
  1348.            
  1349.            Example:
  1350.            
  1351.                INSTANCE_OF ( name   = OBJECT_1,
  1352.                              loc    = (100.23, 20.23, 45.678),
  1353.                              scale  = (.5, .5, .5)
  1354.                            )
  1355.            
  1356.            Optional forms:
  1357.            
  1358.                'loc' = 'pos' = 'location' = 'position'
  1359.            
  1360.            Restrictions:
  1361.            
  1362.                All scale factor entries should be greater than zero.
  1363.            
  1364.                If the scale factor entries are unequal, some primitives
  1365.                  in the instance will not be affected correctly.  For
  1366.                  example, a SPHERE will remain round if scaled by
  1367.                  (1,2,3), not change to a QUADRATIC spheroid.
  1368.            
  1369.            
  1370.            See also : BEGIN_INSTANCES, END_INSTANCES
  1371.            
  1372.            
  1373.         
  1374.         
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.         QRT Ray Tracer               Page 21           Language Reference
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.         
  1394.                                 Setting Defaults
  1395.         
  1396.         DEFAULT:
  1397.            
  1398.            Command type: OPTIONAL
  1399.            
  1400.            QRT sets  certain  defaults  for  the  color  attributes  of a
  1401.            surrface.   The   standard   default   is  for  a  white,  non
  1402.            reflective, non shiny, non  transparent  surface with a medium
  1403.            amount of dithering.  These  defaults  can be changed with the
  1404.            DEFAULT  command.   More  than  one  DEFAULT  command  can  be
  1405.            included, in which case each one  affects all primitives after
  1406.            it and before the  next  DEFAULT  or  the end of the file.  In
  1407.            addition to new surface characteristics, the NO_SHADOW keyword
  1408.            instructs QRT not to compute shadow information for the scene.
  1409.            This can decrease  image  generation  time  at  the expense of
  1410.            image quality.
  1411.            
  1412.            Parameters (optional):
  1413.            
  1414.                no_shadow                   : QRT will not compute
  1415.                                              shadow information
  1416.            
  1417.                amb       = (r,g,b)         : ambient light
  1418.                diff      = (r,g,b)         : diffuse reflection
  1419.                trans     = (r,g,b)         : transmission
  1420.                mirror    = (r,g,b)         : mirror reflection
  1421.                fuzz      = i               : currently unused
  1422.                index     = p               : index of refraction
  1423.                dither    = i               : dithering
  1424.                sreflect  = p               : Phong specular refl. coeff.
  1425.                reflect   = p               : percent specular reflection
  1426.            
  1427.            Example:
  1428.            
  1429.                DEFAULT ( no_shadow,         { ** no shadowing ** }
  1430.                          diff = (1, 0, 0)   { ** default = red objects **
  1431.            }
  1432.                        )
  1433.            
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.         QRT Ray Tracer               Page 22           Language Reference
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.