home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / graphic / qrt / language.doc < prev    next >
Text File  |  1989-03-26  |  42KB  |  1,585 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 shows the 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.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  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.            
  206.         GROUND:
  207.         
  208.            Command type: OPTIONAL
  209.            
  210.            QRT does not have a specific  ground  command.  Instead, use a
  211.            large parallelogram with an optional pattern.
  212.            
  213.                PARALLELOGRAM (  loc = (-10000, 0, -10000),
  214.                                  v1  = ( 20000, 0,      0),
  215.                                  v2  = ( 0,     0,  20000),
  216.            
  217.                                  pattern = PATTERN_OF_CHOICE
  218.                               )
  219.            
  220.            
  221.            It is also possible to use a VERY large sphere for the ground,
  222.            which moves  the  horizon  closer  to  the  observer.  This is
  223.            advisable when rendering tall, reflecting objects.
  224.            
  225.            
  226.            See also : PARALLELOGRAM, SPHERE
  227.            
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  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.         FOC_LENGTH:
  272.            
  273.            Command type: OPTIONAL
  274.            
  275.            This sets the focal length of QRT's  "camera".  The default is
  276.            50, but it can be  changed  with  this  command.  As with 35mm
  277.            photography, larger numbers  result  in  a 'telephoto' effect,
  278.            and smaller numbers will result  in wide angle (and distorted)
  279.            views.  As of QRT 1.5, focal  length  is  no longer resolution
  280.            dependent.
  281.            
  282.            Example:
  283.            
  284.                FOC_LENGTH = 70
  285.            
  286.            Restrictions:
  287.            
  288.                0 < FOC_LENGTH
  289.            
  290.            
  291.         FIRST_SCAN:
  292.            
  293.            Command type: OPTIONAL
  294.            
  295.            This command is obsolete with QRT  version 1.5.  Use the X_RES
  296.            and 
  297.            Y_RES options to the DEFAULT() command.
  298.            
  299.            See also : DEFAULT
  300.            
  301.            
  302.         LAST_SCAN:
  303.            
  304.            Command type: OPTIONAL
  305.            
  306.            This command is also obsolete with QRT 1.5.
  307.            
  308.            See also : DEFAULT
  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.         FILE_NAME:
  339.            
  340.            Command type: REQUIRED
  341.            
  342.            This is used to set  the  output  file  for QRT, which will be
  343.            read by the post processor.  The  file  name will be mapped to
  344.            upper case.   Some  restrictions  may   arise from file naming
  345.            conventions on specific computers.
  346.            
  347.                Example:
  348.            
  349.                    FILE_NAME = QRT_IMAGE.RAW
  350.            
  351.            
  352.         OBSERVER:
  353.            
  354.            Command type: REQUIRED
  355.            
  356.            OBSERVER tells QRT where  the  observer  is  located,  and his
  357.            direction of view.  The view direction  is specified by giving
  358.            the coordinates he should look at.   In addition, the observer
  359.            UP vector may be given.  This is, by default, (0,1,0).
  360.            
  361.            Parameters (required):
  362.            
  363.                loc     = (x,y,z)           : location of observer
  364.                lookat  = (x,y,z)           : point of interest
  365.            
  366.            Parameters (optional):
  367.            
  368.                up      = (x,y,z)           : up vector
  369.            
  370.            Optional forms:
  371.            
  372.                'loc' = 'pos' = 'location' = 'position'
  373.            
  374.            Example:
  375.            
  376.                OBSERVER ( loc    = (0, 0, 0),
  377.                           lookat = (100, 0, 0)
  378.                         )
  379.            
  380.            Restrictions:
  381.            
  382.                The observer cannot  look  in  the  direction  of  the  up
  383.            vector.
  384.                'lookat' cannot be equal to 'loc'.
  385.                'up' must have non-zero length.
  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.                remove  = string            : pattern to cut out
  490.                amb     = (r,g,b)           : ambient light
  491.                diff    = (r,g,b)           : diffuse reflection
  492.                trans   = (r,g,b)           : transmission
  493.                density = (r,g,b)           : light attenuation
  494.                mirror  = (r,g,b)           : mirror reflection
  495.                fuzz    = i                 : currently unused
  496.                index   = p                 : index of refraction
  497.                dither  = i                 : dithering
  498.                sreflect= p                 : Phong specular refl. coeff.
  499.                reflect = p                 : percent specular reflection
  500.            
  501.            Optional forms:
  502.            
  503.                'loc' = 'pos' = 'location' = 'position'
  504.            
  505.            Example:
  506.            
  507.                SPHERE   ( loc    = (100, 100, 50.234),
  508.                           radius = 123.4,
  509.                           diff   = (1.00, .20, .20)
  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.                remove  = string            : pattern to cut out
  555.                amb     = (r,g,b)           : ambient light
  556.                diff    = (r,g,b)           : diffuse reflection
  557.                trans   = (r,g,b)           : transmission
  558.                density = (r,g,b)           : light attenuation
  559.                mirror  = (r,g,b)           : mirror reflection
  560.                fuzz    = i                 : currently unused
  561.                index   = p                 : index of refraction
  562.                dither  = i                 : dithering
  563.                sreflect= p                 : Phong specular refl. coeff.
  564.                reflect = p                 : percent specular reflection
  565.            
  566.            Optional forms:
  567.            
  568.                'loc' = 'pos' = 'location' = 'position'
  569.                'vect1' = 'v1'
  570.                'vect2' = 'v2'
  571.            
  572.            Example:
  573.            
  574.                PARALLELOGRAM ( loc    = (10, 20, 50),
  575.                                vect1  = (20,  0,  0),
  576.                                vect2  = ( 0,  0,  50),
  577.                                diff   = (0, .90, .20)
  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.                remove  = string            : pattern to cut out
  620.                amb     = (r,g,b)           : ambient light
  621.                diff    = (r,g,b)           : diffuse reflection
  622.                trans   = (r,g,b)           : transmission
  623.                density = (r,g,b)           : light attenuation
  624.                mirror  = (r,g,b)           : mirror reflection
  625.                fuzz    = i                 : currently unused
  626.                index   = p                 : index of refraction
  627.                dither  = i                 : dithering
  628.                sreflect= p                 : Phong specular refl. coeff.
  629.                reflect = p                 : percent specular reflection
  630.            
  631.            
  632.            Optional forms:
  633.            
  634.                'loc' = 'pos' = 'location' = 'position'
  635.                'vect1' = 'v1'
  636.                'vect2' = 'v2'
  637.            
  638.            Example:
  639.            
  640.                TRIANGLE      ( loc    = (52, 21, 50),
  641.                                vect1  = (10,  5,  0),
  642.                                vect2  = ( 0,  8, 20),
  643.                                diff   = ( 0,  0,  0),
  644.                                mirror = ( 1,  1,  1)
  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.         RING:
  668.            
  669.            Command type: OPTIONAL
  670.            
  671.            RING creates  a  ring  (annulus),  which  is  a  circle with a
  672.            smaller circle cut out of it.    If  the inner radius is zero,
  673.            the ring will be a  simple  circle.   Two  vectors  define the
  674.            plane of the annulus, as with RING and PARALLELOGRAM.
  675.            
  676.            Parameters (required):
  677.            
  678.                loc     = (x,y,z)           : location of object
  679.                v1      = (x,y,z)           : vector one
  680.                v2      = (x,y,z)           : vector two
  681.                rad_1   = p                 : inner radius
  682.                rad_2   = p                 : outer radius
  683.            
  684.            Parameters (optional):
  685.            
  686.                name    = string            : name for object
  687.                pattern = string            : pattern name to attach
  688.                remove  = string            : pattern to cut out
  689.                amb     = (r,g,b)           : ambient light
  690.                diff    = (r,g,b)           : diffuse reflection
  691.                trans   = (r,g,b)           : transmission
  692.                density = (r,g,b)           : light attenuation
  693.                mirror  = (r,g,b)           : mirror reflection
  694.                fuzz    = i                 : currently unused
  695.                index   = p                 : index of refraction
  696.                dither  = i                 : dithering
  697.                sreflect= p                 : Phong specular refl. coeff.
  698.                reflect = p                 : percent specular reflection
  699.            
  700.            Optional forms:
  701.            
  702.                'loc' = 'pos' = 'location' = 'position'
  703.                'vect1' = 'v1'
  704.                'vect2' = 'v2'
  705.            
  706.            Example:
  707.            
  708.                RING      ( loc    = (52, 21, 50),
  709.                            v1     = (10,  5,  0),
  710.                            v2     = ( 0,  8, 20),
  711.                            rad_1  = 10,
  712.                            rad_2  = 20,
  713.                          )
  714.            
  715.            Restrictions:
  716.            
  717.                0 < rad_1 < rad_2
  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.                remove  = string            : pattern to cut out
  768.                amb     = (r,g,b)           : ambient light
  769.                diff    = (r,g,b)           : diffuse reflection
  770.                trans   = (r,g,b)           : transmission
  771.                density = (r,g,b)           : light attenuation
  772.                mirror  = (r,g,b)           : mirror reflection
  773.                fuzz    = i                 : currently unused
  774.                index   = p                 : index of refraction
  775.                dither  = i                 : dithering
  776.                sreflect= p                 : Phong specular refl. coeff.
  777.                reflect = p                 : percent specular reflection
  778.            
  779.            
  780.            Optional forms:
  781.            
  782.                'loc' = 'pos' = 'location' = 'position'
  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 three types
  890.            of  sub-patterns:  CIRCLE,   RECTANGLE,   and   POLYGON.   The
  891.            sub-pattern list can be  of  any  length  (although long lists
  892.            will slow the ray    tracer), and can use several of each type
  893.            of sub-pattern    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.                POLYGON   = poly_defn       : POLYGON sub-pattern - see
  940.                                              reference for POLYGON.
  941.            
  942.            Example:
  943.            
  944.                 PATTERN ( x_size = 16,
  945.                           y_size = 16,
  946.                           name   = CHECK,
  947.            
  948.                           RECTANGLE (
  949.                             start_x = 0, start_y = 0,
  950.                             end_x   = 8, end_y   = 8,
  951.                             diff    = (1.00, .20, .20);
  952.                           )
  953.            
  954.                           RECTANGLE (
  955.                             start_x = 8,  start_y = 8,
  956.                             end_x   = 16, end_y   = 16,
  957.                             diff    = (1.00, .20, .20);
  958.                           )
  959.                         )
  960.            
  961.                This pattern can now be attached to an object as follows:
  962.            
  963.                SPHERE ( { ** sphere definition here ** }
  964.                         pattern = CHECK,
  965.                         xmult   = .5,
  966.                         ymult   = .5
  967.                       )
  968.            
  969.                Where the xmult and ymult parameters specify a new size
  970.                for the pattern.
  971.            
  972.            Restrictions:
  973.            
  974.                At least one sub-pattern must appear.
  975.            
  976.                If two sub-patterns overlap in a region, the last one
  977.                   defined will be used in this region.
  978.            
  979.            See also : RECTANGLE, CIRCLE, PARALLELOGRAM
  980.  
  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.                density = (r,g,b)           : light attenuation
  1018.                fuzz    = i                 : currently unused
  1019.                index   = p                 : index of refraction
  1020.                dither  = i                 : dithering
  1021.                sreflect= p                 : Phong specular refl. coeff.
  1022.                reflect = p                 : percent specular reflection
  1023.            
  1024.            Example:
  1025.            
  1026.                RECTANGLE (
  1027.                    start_x = 10, start_y = 12,
  1028.                    end_x   = 15, end_y   = 15,
  1029.            
  1030.                    diff    = (1.00, .20, .20);
  1031.                )
  1032.            
  1033.            Restrictions:
  1034.            
  1035.                RECTANGLE should be used only within a pattern definition.
  1036.                start_x < end_x
  1037.                start_y < end_y
  1038.            
  1039.            See also : PATTERN
  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.                density = (r,g,b)           : light attenuation
  1081.                fuzz    = i                 : currently unused
  1082.                index   = p                 : index of refraction
  1083.                dither  = i                 : dithering
  1084.                sreflect= p                 : Phong specular refl. coeff.
  1085.                reflect = p                 : percent specular reflection
  1086.            
  1087.            Example:
  1088.            
  1089.                CIRCLE (
  1090.                  radius  = 5,
  1091.                  diff    = (1.00, .20, .20);
  1092.                )
  1093.            
  1094.            Restrictions:
  1095.            
  1096.                CIRCLE should be used only within a pattern definition.
  1097.            
  1098.            
  1099.            See also : PATTERN
  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.         POLYGON:
  1130.            
  1131.            Command type: OPTIONAL
  1132.            
  1133.            POLYGON is a type of sub-pattern.
  1134.            
  1135.            Parameters (required):
  1136.            
  1137.                point   = (x,y)             : a point of the polygon.  Any
  1138.                                              number of points can be
  1139.                                              defined, but at least four
  1140.                                              must be defined, with the
  1141.                                              last the same as the first.
  1142.            
  1143.            Parameters (optional):
  1144.            
  1145.                amb     = (r,g,b)           : ambient light
  1146.                diff    = (r,g,b)           : diffuse reflection
  1147.                trans   = (r,g,b)           : transmission
  1148.                mirror  = (r,g,b)           : mirror reflection
  1149.                density = (r,g,b)           : light attenuation
  1150.                fuzz    = i                 : currently unused
  1151.                index   = p                 : index of refraction
  1152.                dither  = i                 : dithering
  1153.                sreflect= p                 : Phong specular refl. coeff.
  1154.                reflect = p                 : percent specular reflection
  1155.            
  1156.            Example:
  1157.            
  1158.                POLYGON (
  1159.                  point = (0,0),      { triangle pattern }
  1160.                  point = (10, 0),
  1161.                  point = (0, 10),
  1162.                  point = (0,0)
  1163.                )
  1164.            
  1165.            
  1166.            Restrictions:
  1167.            
  1168.                POLYGON should be used only within a pattern definition.
  1169.                The last point defined must be the same as the first.
  1170.                At least 4 points must appear, with the last the same
  1171.                  as the first.
  1172.            
  1173.            See also : PATTERN
  1174.            
  1175.            
  1176.  
  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.                                  Bounding Boxes
  1197.         
  1198.         
  1199.         BEGIN_BBOX:
  1200.            
  1201.            Command type: OPTIONAL
  1202.            
  1203.            The BEGIN_BBOX, END_BBOX  commands  form an enclosing bounding
  1204.            box around  a  group  of  objects  (which  may  include  other
  1205.            bounding boxes).  An optional  name  must precede the bounding
  1206.            box begin statement.  Bounding  boxes  cannot be given surface
  1207.            characteristics, since they are conceptual objects.
  1208.            
  1209.            Parameters (optional):
  1210.            
  1211.                name    = string            : name for box
  1212.            
  1213.            Example:
  1214.            
  1215.                name = SAMPLE_BBOX
  1216.                BEGIN_BBOX
  1217.                    SPHERE   ();            { ** sphere    here ** }
  1218.                    TRIANGLE ();            { ** triangle  here ** }
  1219.                END_BBOX
  1220.            
  1221.            Restrictions:
  1222.            
  1223.                Must be paired with an END_BBOX statement.
  1224.            
  1225.            
  1226.            
  1227.         END_BBOX:
  1228.            
  1229.            Command type: OPTIONAL
  1230.            
  1231.            Companion command to BEGIN_BBOX.
  1232.            
  1233.            Example:
  1234.            
  1235.                name = SAMPLE_BBOX
  1236.                BEGIN_BBOX
  1237.                    SPHERE   ();            { ** sphere    here ** }
  1238.                    TRIANGLE ();            { ** triangle  here ** }
  1239.                END_BBOX
  1240.            
  1241.            Restrictions:
  1242.            
  1243.                Must be paired with a BEGIN_BBOX statement.
  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.         
  1263.                                     Instances
  1264.         
  1265.         
  1266.         
  1267.         BEGIN_INSTANCES:
  1268.            
  1269.            Command type: OPTIONAL
  1270.            
  1271.            Several primitives may be grouped into an 'instance', and this
  1272.            group can easily be placed in several locations.  In addition,
  1273.            it can be resized.  All  instance  definitions  must be placed
  1274.            within the BEGIN_INSTANCES and END_INSTANCES  statements; only
  1275.            one set of these statements  is  allowed.   A group of objects
  1276.            must be placed in a BBOX, and this  BBOX must be given a name.
  1277.            In the following example, three objects are defined: OBJECT_1,
  1278.            SUB_OBJECT_1, and  OBJECT_2.  Any  inclusion  of OBJECT_1 will
  1279.            implicitly  include   SUB_OBJECT_1,  but  not  OBJECT_2.   Any
  1280.            arbitrary object tree can  be  included.  Referring  to a node
  1281.            will include the sub-tree rooted at that node.
  1282.            
  1283.            Example:
  1284.            
  1285.                BEGIN_INSTANCES
  1286.            
  1287.                    NAME = OBJECT_1
  1288.                    BEGIN_BBOX
  1289.            
  1290.                        { ** some primitives here ** }
  1291.                        NAME = SUB_OBJECT_1
  1292.                        BEGIN_BBOX
  1293.                          { ** some more primitives here ** }
  1294.                        END_BBOX
  1295.                    END_BBOX
  1296.            
  1297.                    NAME = OBJECT_2
  1298.                    BEGIN_BBOX
  1299.                        { ** more primitives ** }
  1300.                    END_BBOX
  1301.            
  1302.                END_INSTANCES
  1303.            
  1304.            Restrictions:
  1305.            
  1306.                There can be only one BEGIN_INSTANCES statement.
  1307.                There must be a matching END_INSTANCES statement.
  1308.            
  1309.            See also: END_INSTANCES, INSTANCE_OF
  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.         END_INSTANCES:
  1329.            
  1330.            Command type : OPTIONAL
  1331.            
  1332.            This command specifies  the  end  of  the  instance tree.  Any
  1333.            primitive  after  the  END_INSTANCES  statement  are  actually
  1334.            displayed as part of the image.
  1335.            
  1336.            Restrictions:
  1337.            
  1338.                There can be only one END_INSTANCES statement.
  1339.            
  1340.            See Also:  BEGIN_INSTANCES, INSTANCE_OF
  1341.            
  1342.            
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  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.         INSTANCE_OF:
  1395.            
  1396.            Command type: OPTIONAL
  1397.            
  1398.            After an instance tree is  defined  with  the BEGIN_INSTANCES,
  1399.            END_INSTANCES command pair, parts  of the tree can be referred
  1400.            to with the  INSTANCE_OF  statement.   This  actually puts the
  1401.            sub-tree in the image.  You must specify the name of the  root
  1402.            of the sub-tree.   The  original  instance  should  be defined
  1403.            relative to (0,0,0),  and  the  location  parameter  specifies
  1404.            where the new copy will go.
  1405.            
  1406.            Parameters (required):
  1407.            
  1408.                name    = string            : name of sub-tree
  1409.                loc     = (x,y,z)           : location for instance
  1410.            
  1411.            Parameters (optional):
  1412.            
  1413.                scale   = (x,y,z)           : scale factor
  1414.            
  1415.            Example:
  1416.            
  1417.                INSTANCE_OF ( name   = OBJECT_1,
  1418.                              loc    = (100.23, 20.23, 45.678),
  1419.                              scale  = (.5, .5, .5)
  1420.                            )
  1421.            
  1422.            Optional forms:
  1423.            
  1424.                'loc' = 'pos' = 'location' = 'position'
  1425.            
  1426.            Restrictions:
  1427.            
  1428.                All scale factor entries should be greater than zero.
  1429.            
  1430.                If the scale factor entries are unequal, some primitives
  1431.                  in the instance will not be affected correctly.  For
  1432.                  example, a SPHERE will remain round if scaled by
  1433.                  (1,2,3), not change to a QUADRATIC spheroid.
  1434.            
  1435.            
  1436.            See also : BEGIN_INSTANCES, END_INSTANCES
  1437.            
  1438.            
  1439.         
  1440.         
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.         QRT Ray Tracer               Page 22           Language Reference
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.         
  1460.                                 Setting Defaults
  1461.         
  1462.         DEFAULT:
  1463.            
  1464.            Command type: OPTIONAL
  1465.            
  1466.            QRT sets  certain  defaults  for  the  color  attributes  of a
  1467.            surface.   The   standard   default   is   for  a  white,  non
  1468.            reflective, non shiny, non  transparent  surface with a medium
  1469.            amount of dithering.  These  defaults  can be changed with the
  1470.            DEFAULT  command.   More  than  one  DEFAULT  command  can  be
  1471.            included, in which case each one  affects all primitives after
  1472.            it and before the  next  DEFAULT  or  the end of the file.  In
  1473.            addition to new surface characteristics, the NO_SHADOW keyword
  1474.            instructs QRT not to compute shadow information for the scene.
  1475.            This can decrease  image  generation  time  at  the expense of
  1476.            image quality.  X and Y resolution  and image aspect ratio can
  1477.            be set in the  DEFAULT  command.   If  they  are set more than
  1478.            once, the values from the last DEFAULT command are taken.
  1479.            
  1480.            The aspect ratio for any monitor can be determined as follows:
  1481.            
  1482.                 aspect ratio = (XR/XD)/(YR/YD)
  1483.            
  1484.            where:
  1485.            
  1486.                 XR = X resolution of monitor
  1487.                 XD = width of monitor in arbitrary units
  1488.            
  1489.                 YR = Y resolution of monitor
  1490.                 YD = height length of monitor in arbitrary units
  1491.            
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.         QRT Ray Tracer               Page 23           Language Reference
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.            
  1526.            Parameters (optional):
  1527.            
  1528.                no_shadow                   : QRT will not compute
  1529.                                              shadow information
  1530.            
  1531.                threshold = p               : QRT will stop tracing
  1532.                                              reflected or transmitted
  1533.                                              rays when they reach this
  1534.                                              percent of their original
  1535.                                              intensity.
  1536.            
  1537.                x_res     = p               : X image resolution.  Any
  1538.                                              command line arguments
  1539.                                              override this parameter.
  1540.            
  1541.                x_res     = p               : Y image resolution.  Any
  1542.                                              command line arguments
  1543.                                              override this parameter.
  1544.            
  1545.                aspect    = p               : image aspect ratio.  This
  1546.                                              is computer and resolution
  1547.                                              dependent.
  1548.            
  1549.                amb       = (r,g,b)         : ambient light
  1550.                diff      = (r,g,b)         : diffuse reflection
  1551.                trans     = (r,g,b)         : transmission
  1552.                density   = (r,g,b)         : light attenuation
  1553.                mirror    = (r,g,b)         : mirror reflection
  1554.                fuzz      = i               : currently unused
  1555.                index     = p               : index of refraction
  1556.                dither    = i               : dithering
  1557.                sreflect  = p               : Phong specular refl. coeff.
  1558.                reflect   = p               : percent specular reflection
  1559.            
  1560.            Example:
  1561.            
  1562.                DEFAULT ( no_shadow,         { * no shadowing * }
  1563.                          diff = (1, 0, 0)   { * default = red objects * }
  1564.            
  1565.                          x_res  = 1280,  { ** BIG image ** }
  1566.                          y_res  = 1024,
  1567.                          aspect = .89
  1568.                );
  1569.            
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.         QRT Ray Tracer               Page 24           Language Reference
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.