home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / paint / m / qrt / QRTdocs / Language < prev    next >
Encoding:
Text File  |  1989-05-23  |  22.4 KB  |  908 lines

  1.                             QRT Language Reference
  2.  
  3. INTRODUCTION
  4.  
  5.  This document is a reference guide to the QRT command language. One section
  6. is devoted to each QRT command. All parameters to commands are listed.
  7.  
  8.  More information on QRT can be found in the User's Manual and Technical
  9. Reference Manual.
  10.  
  11.  The following table shows the syntax used in this document:
  12.  
  13.  TEXT    MEANING            EXAMPLE          RANGE
  14.  
  15.  (x,y,z) floating pt vector (10, -20, 30.56) all
  16.  
  17.  (r,g,b) color value triple (0, .5, 1.00)    0 to 1
  18.  
  19.  i       an integer         12               0 to 127
  20.  
  21.  n       floating pt number -123.4           all
  22.  
  23.  p       positive float     123.4            >0
  24.  
  25.  string  text string        FOO_BAR          ASCII
  26.  
  27.  Each section of this document contains one or more of the following
  28. sub-sections:
  29.  
  30.  Command Type : OPTIONAL or REQUIRED
  31.  
  32.  Parameters (required) : Lists required parameters
  33.  Parameters (optional) : Lists optional parameters
  34.  
  35.  Optional Forms : Alternatives for parameter names. Ex: 'horiz' = 'horizon'
  36. means either can be used as a parameter name.
  37.  
  38.  Example : An example of the command (with all required parameters, but not
  39. necessarily all optional ones.
  40.  
  41.  Restrictions : Things not to do
  42.  
  43.  See also : Similar commands
  44.  
  45.  QRT has a free format input language, and parameters can be given in any
  46. order.
  47.  
  48. QRT Misc. Setup Commands
  49.  
  50.  
  51. SKY:
  52.  
  53.  Command type: OPTIONAL
  54.  
  55.  The SKY command is used to specify the color of all rays that don't hit any
  56. other object. The sky is black by default. The sky color at the zenith (up),
  57. and horizon can be specified, and QRT will blend the colors in between as
  58. smoothly as possible. In addition, dithering can be specified.
  59.  
  60.  Parameters (optional):
  61.  
  62.  zenith = (r,g,b) : the color of the zenith
  63.  horiz  = (r,g,b) : the color at the horizon
  64.  dither = i       : dithering
  65.  
  66.  Optional forms:
  67.  
  68.  'horiz' = 'horizon'
  69.  
  70.  Example:
  71.  
  72.  SKY ( horiz  = (0, 0, .6),
  73.        zenith = (0, 0, .4),
  74.        dither = 5
  75.      )
  76.  
  77.  See also : GROUND
  78.  
  79.  
  80. GROUND:
  81.  
  82.  Command type: OPTIONAL
  83.  
  84.  QRT does not have a specific ground command. Instead, use a large
  85. parallelogram with an optional pattern.
  86.  
  87.  PARALLELOGRAM ( loc = (-10000, 0, -10000),
  88.                  v1  = ( 20000, 0, 0),
  89.                  v2  = ( 0, 0, 20000),
  90.  
  91.                  pattern = PATTERN_OF_CHOICE
  92.                )
  93.  
  94.  It is also possible to use a VERY large sphere for the ground, which moves
  95. the horizon closer to the observer. This is advisable when rendering tall,
  96. reflecting objects.
  97.  
  98.  See also : PARALLELOGRAM, SPHERE
  99.  
  100.  
  101. FOC_LENGTH:
  102.  
  103.  Command type: OPTIONAL
  104.  
  105.  This sets the focal length of QRT's "camera". The default is 50, but it can
  106. be changed with this command. As with 35mm photography, larger numbers
  107. result in a 'telephoto' effect, and smaller numbers will result in wide
  108. angle (and distorted) views. As of QRT 1.5, focal length is no longer
  109. resolution dependent.
  110.  
  111.  Example:
  112.  
  113.  FOC_LENGTH = 70
  114.  
  115.  Restrictions:
  116.  
  117.  0 < FOC_LENGTH
  118.  
  119.  
  120. FIRST_SCAN:
  121.  
  122.  Command type: OPTIONAL
  123.  
  124.  This command is obsolete with QRT version 1.5. Use the X_RES
  125.  and Y_RES options to the DEFAULT() command.
  126.  
  127.  See also : DEFAULT
  128.  
  129.  
  130. LAST_SCAN:
  131.  
  132.  Command type: OPTIONAL
  133.  
  134.  This command is also obsolete with QRT 1.5.
  135.  
  136.  See also : DEFAULT
  137.  
  138.  
  139. FILE_NAME:
  140.  
  141.  Command type: REQUIRED
  142.  
  143.  This is used to set the output file for QRT, which will be read by the post
  144. processor. The file name will be mapped to upper case. Some restrictions may
  145. arise from file naming conventions on specific computers.
  146.  
  147.  Example:
  148.  
  149.  FILE_NAME = QRT_IMAGE.RAW
  150.  
  151.  
  152. OBSERVER:
  153.  
  154.  Command type: REQUIRED
  155.  
  156.  OBSERVER tells QRT where the observer is located, and his direction of
  157. view. The view direction is specified by giving the coordinates he should
  158. look at. In addition, the observer UP vector may be given. This is, by
  159. default, (0,1,0).
  160.  
  161.  Parameters (required):
  162.  
  163.  loc    = (x,y,z) : location of observer
  164.  lookat = (x,y,z) : point of interest
  165.  
  166.  Parameters (optional):
  167.  
  168.  up = (x,y,z) : up vector
  169.  
  170.  Optional forms:
  171.  
  172.  'loc' = 'pos' = 'location' = 'position'
  173.  
  174.  Example:
  175.  
  176.  OBSERVER ( loc    = (0, 0, 0),
  177.             lookat = (100, 0, 0)
  178.           )
  179.  
  180.  Restrictions:
  181.  
  182.  The observer cannot look in the direction of the up vector.
  183.  'lookat' cannot be equal to 'loc'.
  184.  'up' must have non-zero length.
  185.  
  186.  
  187. LAMP:
  188.  
  189.  Command type: OPTIONAL
  190.  
  191.  Lamps are sources of light in QRT. They can be placed anywhere, and emit
  192. any color and intensity of light. The ambient light value is the color of
  193. the lamp. The distance parameter is the minimum distance from the lamp that
  194. objects will be illuminated at full intensity. Most objects should be
  195. farther from the lamp than this value, or else they will be washed out. The
  196. radius parameter is ignored by this version of QRT, but may eventually be
  197. used to implement penumbral shadows.
  198.  
  199.  Parameters (required):
  200.  
  201.  loc  = (x,y,z) : location of object
  202.  dist = p       : distance of max illumination
  203.  
  204.  Parameters (optional):
  205.  
  206.  amb    = (r,g,b) : ambient light
  207.  radius = p       : radius
  208.  
  209.  Optional forms:
  210.  
  211.  'loc' = 'pos' = 'location' = 'position'
  212.  
  213.  Example:
  214.  
  215.  LAMP ( loc    = (12,34,56),
  216.         radius = 123.4,
  217.       )
  218.  
  219.  
  220. QRT Primitive Types
  221.  
  222.  
  223. SPHERE:
  224.  
  225.  Command type: OPTIONAL
  226.  
  227.  SPHERE creates a sphere with a given location, radius, and surface
  228. characteristics.
  229.  
  230.  Parameters (required):
  231.  
  232.  loc    = (x,y,z) : location of object
  233.  radius = p       : radius
  234.  
  235.  Parameters (optional):
  236.  
  237.  name     = string  : name for object
  238.  pattern  = string  : pattern name to attach
  239.  remove   = string  : pattern to cut out
  240.  amb      = (r,g,b) : ambient light
  241.  diff     = (r,g,b) : diffuse reflection
  242.  trans    = (r,g,b) : transmission
  243.  density  = (r,g,b) : light attenuation
  244.  mirror   = (r,g,b) : mirror reflection
  245.  fuzz     = i       : currently unused
  246.  index    = p       : index of refraction
  247.  dither   = i       : dithering
  248.  sreflect = p       : Phong specular refl. coeff.
  249.  reflect  = p       : percent specular reflection
  250.  
  251.  Optional forms:
  252.  
  253.  'loc' = 'pos' = 'location' = 'position'
  254.  
  255.  Example:
  256.  
  257.  SPHERE ( loc = (100, 100, 50.234),
  258.           radius = 123.4,
  259.           diff = (1.00, .20, .20)
  260.         )
  261.  
  262.  
  263. PARALLELOGRAM:
  264.  
  265.  Command type: OPTIONAL
  266.  
  267.  This command creates a parallelogram with a given location, shape, and
  268. surface characteristics. Two vectors define the shape of the parallelogram
  269. (they need not be orthogonal).
  270.  
  271.  Parameters (required):
  272.  
  273.  loc = (x,y,z) : location of object
  274.  v1  = (x,y,z) : vector for side one
  275.  v2  = (x,y,z) : vector for side two
  276.  
  277.  Parameters (optional):
  278.  
  279.  name     = string  : name for object
  280.  pattern  = string  : pattern name to attach
  281.  remove   = string  : pattern to cut out
  282.  amb      = (r,g,b) : ambient light
  283.  diff     = (r,g,b) : diffuse reflection
  284.  trans    = (r,g,b) : transmission
  285.  density  = (r,g,b) : light attenuation
  286.  mirror   = (r,g,b) : mirror reflection
  287.  fuzz     = i       : currently unused
  288.  index    = p       : index of refraction
  289.  dither   = i       : dithering
  290.  sreflect = p       : Phong specular refl. coeff.
  291.  reflect  = p       : percent specular reflection
  292.  
  293.  Optional forms:
  294.  
  295.  'loc' = 'pos' = 'location' = 'position'
  296.  'vect1' = 'v1'
  297.  'vect2' = 'v2'
  298.  
  299.  Example:
  300.  
  301.  PARALLELOGRAM ( loc = (10, 20, 50),
  302.                  vect1 = (20, 0, 0),
  303.                  vect2 = ( 0, 0, 50),
  304.                  diff = (0, .90, .20)
  305.                )
  306.  
  307.  
  308. TRIANGLE:
  309.  
  310.  Command type: OPTIONAL
  311.  
  312.  The TRIANGLE command (similar to PARALLELOGRAM) creates a triangle shape.
  313. Two vectors define the sides of the triangle.
  314.  
  315.  Parameters (required):
  316.  
  317.  loc = (x,y,z) : location of object
  318.  v1  = (x,y,z) : vector for side one
  319.  v2  = (x,y,z) : vector for side two
  320.  
  321.  Parameters (optional):
  322.  
  323.  name     = string  : name for object
  324.  pattern  = string  : pattern name to attach
  325.  remove   = string  : pattern to cut out
  326.  amb      = (r,g,b) : ambient light
  327.  diff     = (r,g,b) : diffuse reflection
  328.  trans    = (r,g,b) : transmission
  329.  density  = (r,g,b) : light attenuation
  330.  mirror   = (r,g,b) : mirror reflection
  331.  fuzz     = i       : currently unused
  332.  index    = p       : index of refraction
  333.  dither   = i       : dithering
  334.  sreflect = p       : Phong specular refl. coeff.
  335.  reflect  = p       : percent specular reflection
  336.  
  337.  Optional forms:
  338.  
  339.  'loc' = 'pos' = 'location' = 'position'
  340.  'vect1' = 'v1'
  341.  'vect2' = 'v2'
  342.  
  343.  Example:
  344.  
  345.  TRIANGLE ( loc = (52, 21, 50),
  346.             vect1 = (10, 5, 0),
  347.             vect2 = ( 0, 8, 20),
  348.             diff = ( 0, 0, 0),
  349.             mirror = ( 1, 1, 1)
  350.           );
  351.  
  352.  
  353. RING:
  354.  
  355.  Command type: OPTIONAL
  356.  
  357.  RING creates a ring (annulus), which is a circle with a smaller circle cut
  358. out of it. If the inner radius is zero, the ring will be a simple circle.
  359. Two vectors define the plane of the annulus, as with RING and PARALLELOGRAM.
  360.  
  361.  Parameters (required):
  362.  
  363.  loc   = (x,y,z) : location of object
  364.  v1    = (x,y,z) : vector one
  365.  v2    = (x,y,z) : vector two
  366.  rad_1 = p       : inner radius
  367.  rad_2 = p       : outer radius
  368.  
  369.  Parameters (optional):
  370.  
  371.  name     = string  : name for object
  372.  pattern  = string  : pattern name to attach
  373.  remove   = string  : pattern to cut out
  374.  amb      = (r,g,b) : ambient light
  375.  diff     = (r,g,b) : diffuse reflection
  376.  trans    = (r,g,b) : transmission
  377.  density  = (r,g,b) : light attenuation
  378.  mirror   = (r,g,b) : mirror reflection
  379.  fuzz     = i       : currently unused
  380.  index    = p       : index of refraction
  381.  dither   = i       : dithering
  382.  sreflect = p       : Phong specular refl. coeff.
  383.  reflect  = p       : percent specular reflection
  384.  
  385.  Optional forms:
  386.  
  387.  'loc' = 'pos' = 'location' = 'position'
  388.  'vect1' = 'v1'
  389.  'vect2' = 'v2'
  390.  
  391.  Example:
  392.  
  393.  RING ( loc = (52, 21, 50),
  394.         v1 = (10, 5, 0),
  395.         v2 = ( 0, 8, 20),
  396.         rad_1 = 10,
  397.         rad_2 = 20,
  398.       )
  399.  
  400.  Restrictions:
  401.  
  402.  0 < rad_1 < rad_2
  403.  
  404.  
  405. QUADRATIC:
  406.  
  407.  Command type: OPTIONAL
  408.  
  409.  This command creates a quadratic surface given by the equation:
  410.  
  411.     2     2     2
  412.  a x + b y + c z = d
  413.  
  414.  The coefficients a,b,c and d can be specified. This primitive can be used
  415. to create cylinders, cones, oblong spheroids, etc. Several min and max
  416. parameters specify the maximum extents of the surface.
  417.  
  418.  Parameters (required):
  419.  
  420.  loc  = (x,y,z) : location of object
  421.  a    = n
  422.  b    = n
  423.  c    = n
  424.  d    = n
  425.  xmax = n
  426.  xmin = n
  427.  ymax = n
  428.  ymin = n
  429.  zmax = n
  430.  zmin = n
  431.  
  432.  Parameters (optional):
  433.  
  434.  name     = string  : name for object
  435.  pattern  = string  : pattern name to attach
  436.  remove   = string  : pattern to cut out
  437.  amb      = (r,g,b) : ambient light
  438.  diff     = (r,g,b) : diffuse reflection
  439.  trans    = (r,g,b) : transmission
  440.  density  = (r,g,b) : light attenuation
  441.  mirror   = (r,g,b) : mirror reflection
  442.  fuzz     = i       : currently unused
  443.  index    = p       : index of refraction
  444.  dither   = i       : dithering
  445.  sreflect = p       : Phong specular refl. coeff.
  446.  reflect  = p       : percent specular reflection
  447.  
  448.  Optional forms:
  449.  
  450.  'loc' = 'pos' = 'location' = 'position'
  451.  
  452.  Example:
  453.  
  454.  { ** vertical cylinder ** }
  455.  
  456.  QUADRATIC ( loc = (57, 21.2, 0),
  457.              a = 1,
  458.              b = 0,
  459.              c = 1,
  460.              d = 100
  461.            );
  462.  
  463.  Restrictions:
  464.  
  465.  a != 0 or b != 0 or c != 0
  466.  
  467.  
  468. Patterned Surfaces
  469.  
  470.  
  471. PATTERN:
  472.  
  473.  Command type: OPTIONAL
  474.  
  475.  This command creates a pattern definition which can be attached to any
  476. primitive object. A pattern is a two dimensional array than can be mapped to
  477. the surface of any primitive. Patterns must be defined before they are used.
  478. The PATTERN keyword serves two functions: to create a pattern definition,
  479. and to attach this definition to a primitive. The correct meaning is found
  480. by context: if the PATTERN keyword appears in a primitive definition
  481. followed by a name, it is assumed to refer to a predefined pattern. However,
  482. if PATTERN occurs outside any primitive definition, it is assumed to be a
  483. pattern definition. If all the pattern definitions are grouped at the top of
  484. the file, they will always be defined before they are used.
  485.  
  486.  A pattern is defined by giving it a size, a name, and one or more
  487. sub-pattern definitions. There are currently three types of sub-patterns:
  488. CIRCLE, RECTANGLE, and POLYGON. The sub-pattern list can be of any length
  489. (although long lists will slow the ray tracer), and can use several of each
  490. type of sub-pattern primitive.
  491.  
  492.  The X and Y size parameters specify the size of the pattern; the pattern
  493. will be repeated over the surface of an object each X or Y units in the
  494. indicated direction. These size units are arbitrary, since the pattern can
  495. be given a new size when attached to an object.
  496.  
  497.  In each sub-pattern, any object surface characteristics can be specified.
  498. If a given ray hits this sub-pattern, the surface will be colored as
  499. indicated. If it does not hit any sub pattern in the list, the objects
  500. default surface characteristics will be used. The example below defines a
  501. red-checkered pattern. The background color of the object to which this
  502. pattern is attached will determine the color of the other checker box in the
  503. pattern.
  504.  
  505.  Parameters (required):
  506.  
  507.  name   = string : name for pattern
  508.  x_size = p      : x size of pattern
  509.  y_size = p      : y size of pattern
  510.  
  511.  Parameters (optional):
  512.  
  513.  CIRCLE  = circle_defn : CIRCLE sub-pattern - see reference for CIRCLE
  514.  
  515.  RECTANGLE = rect_defn : RECTANGLE sub-pattern - see reference for RECTANGLE
  516.  
  517.  POLYGON   = poly_defn : POLYGON sub-pattern - see reference for POLYGON.
  518.  
  519.  Example:
  520.  
  521.  PATTERN ( x_size = 16,
  522.            y_size = 16,
  523.            name = CHECK,
  524.  
  525.            RECTANGLE (
  526.                        start_x = 0, start_y = 0,
  527.                        end_x = 8, end_y = 8,
  528.                        diff = (1.00, .20, .20);
  529.                      )
  530.  
  531.            RECTANGLE (
  532.                        start_x = 8, start_y = 8,
  533.                        end_x = 16, end_y = 16,
  534.                        diff = (1.00, .20, .20);
  535.                      )
  536.          )
  537.  
  538.  This pattern can now be attached to an object as follows:
  539.  
  540.  SPHERE ( { ** sphere definition here ** }
  541.           pattern = CHECK,
  542.           xmult = .5,
  543.           ymult = .5
  544.         )
  545.  
  546.  Where the xmult and ymult parameters specify a new size for the pattern.
  547.  
  548.  Restrictions:
  549.  
  550.  At least one sub-pattern must appear.
  551.  
  552.  If two sub-patterns overlap in a region, the last one defined will be used
  553. in this region.
  554.  
  555.  See also : RECTANGLE, CIRCLE, PARALLELOGRAM
  556.  
  557.  
  558. RECTANGLE:
  559.  
  560.  Command type: OPTIONAL
  561.  
  562.  RECTANGLE is a type of sub-pattern.
  563.  
  564.  Parameters (required):
  565.  
  566.  start_x = p : start position for rectangle
  567.  start_y = p
  568.  end_x   = p : end position for rectangle
  569.  end_y   = p
  570.  
  571.  Parameters (optional):
  572.  
  573.  amb      = (r,g,b) : ambient light
  574.  diff     = (r,g,b) : diffuse reflection
  575.  trans    = (r,g,b) : transmission
  576.  mirror   = (r,g,b) : mirror reflection
  577.  density  = (r,g,b) : light attenuation
  578.  fuzz     = i       : currently unused
  579.  index    = p       : index of refraction
  580.  dither   = i       : dithering
  581.  sreflect = p       : Phong specular refl. coeff.
  582.  reflect  = p       : percent specular reflection
  583.  
  584.  Example:
  585.  
  586.  RECTANGLE (
  587.              start_x = 10, start_y = 12,
  588.              end_x = 15, end_y = 15,
  589.  
  590.              diff = (1.00, .20, .20);
  591.            )
  592.  
  593.  Restrictions:
  594.  
  595.  RECTANGLE should be used only within a pattern definition.
  596.  start_x < end_x
  597.  start_y < end_y
  598.  
  599.  See also : PATTERN
  600.  
  601.  
  602. CIRCLE:
  603.  
  604.  Command type: OPTIONAL
  605.  
  606.  CIRCLE is a type of sub-pattern.
  607.  
  608.  Parameters (required):
  609.  
  610.  radius = p : radius
  611.  
  612.  Parameters (optional):
  613.  
  614.  amb      = (r,g,b) : ambient light
  615.  diff     = (r,g,b) : diffuse reflection
  616.  trans    = (r,g,b) : transmission
  617.  mirror   = (r,g,b) : mirror reflection
  618.  density  = (r,g,b) : light attenuation
  619.  fuzz     = i       : currently unused
  620.  index    = p       : index of refraction
  621.  dither   = i       : dithering
  622.  sreflect = p       : Phong specular refl. coeff.
  623.  reflect  = p       : percent specular reflection
  624.  
  625.  Example:
  626.  
  627.  CIRCLE (
  628.           radius = 5,
  629.           diff = (1.00, .20, .20);
  630.         )
  631.  
  632.  Restrictions:
  633.  
  634.  CIRCLE should be used only within a pattern definition.
  635.  
  636.  See also : PATTERN
  637.  
  638.  
  639. POLYGON:
  640.  
  641.  Command type: OPTIONAL
  642.  
  643.  POLYGON is a type of sub-pattern.
  644.  
  645.  Parameters (required):
  646.  
  647.  point = (x,y) : a point of the polygon. Any
  648.                  number of points can be
  649.                  defined, but at least four
  650.                  must be defined, with the
  651.                  last the same as the first.
  652.  
  653.  Parameters (optional):
  654.  
  655.  amb      = (r,g,b) : ambient light
  656.  diff     = (r,g,b) : diffuse reflection
  657.  trans    = (r,g,b) : transmission
  658.  mirror   = (r,g,b) : mirror reflection
  659.  density  = (r,g,b) : light attenuation
  660.  fuzz     = i       : currently unused
  661.  index    = p       : index of refraction
  662.  dither   = i       : dithering
  663.  sreflect = p       : Phong specular refl. coeff.
  664.  reflect  = p       : percent specular reflection
  665.  
  666.  Example:
  667.  
  668.  POLYGON (
  669.            point = (0,0), { triangle pattern }
  670.            point = (10, 0),
  671.            point = (0, 10),
  672.            point = (0,0)
  673.          )
  674.  
  675.  Restrictions:
  676.  
  677.  POLYGON should be used only within a pattern definition. The last point
  678. defined must be the same as the first. At least 4 points must appear, with
  679. the last the same as the first.
  680.  
  681.  See also : PATTERN
  682.  
  683.  
  684. Bounding Boxes
  685.  
  686.  
  687. BEGIN_BBOX:
  688.  
  689.  Command type: OPTIONAL
  690.  
  691.  The BEGIN_BBOX, END_BBOX commands form an enclosing bounding box around a
  692. group of objects (which may include other bounding boxes). An optional name
  693. must precede the bounding box begin statement. Bounding boxes cannot be
  694. given surface characteristics, since they are conceptual objects.
  695.  
  696.  Parameters (optional):
  697.  
  698.  name = string : name for box
  699.  
  700.  Example:
  701.  
  702.  name = SAMPLE_BBOX
  703.  BEGIN_BBOX
  704.    SPHERE (); { ** sphere here ** }
  705.    TRIANGLE (); { ** triangle here ** }
  706.  END_BBOX
  707.  
  708.  Restrictions:
  709.  
  710.  Must be paired with an END_BBOX statement.
  711.  
  712.  
  713. END_BBOX:
  714.  
  715.  Command type: OPTIONAL
  716.  
  717.  Companion command to BEGIN_BBOX.
  718.  
  719.  Example:
  720.  
  721.  name = SAMPLE_BBOX
  722.  BEGIN_BBOX
  723.    SPHERE (); { ** sphere here ** }
  724.    TRIANGLE (); { ** triangle here ** }
  725.  END_BBOX
  726.  
  727.  Restrictions:
  728.  
  729.  Must be paired with a BEGIN_BBOX statement.
  730.  
  731.  
  732. Instances
  733.  
  734.  
  735. BEGIN_INSTANCES:
  736.  
  737.  Command type: OPTIONAL
  738.  
  739.  Several primitives may be grouped into an 'instance', and this group can
  740. easily be placed in several locations. In addition, it can be resized. All
  741. instance definitions must be placed within the BEGIN_INSTANCES and
  742. END_INSTANCES statements; only one set of these statements is allowed. A
  743. group of objects must be placed in a BBOX, and this BBOX must be given a
  744. name. In the following example, three objects are defined: OBJECT_1,
  745. SUB_OBJECT_1, and OBJECT_2. Any inclusion of OBJECT_1 will implicitly
  746. include SUB_OBJECT_1, but not OBJECT_2. Any arbitrary object tree can be
  747. included. Referring to a node will include the sub-tree rooted at that node.
  748.  
  749.  Example:
  750.  
  751.  BEGIN_INSTANCES
  752.  
  753.    NAME = OBJECT_1
  754.    BEGIN_BBOX
  755.  
  756.      { ** some primitives here ** }
  757.      NAME = SUB_OBJECT_1
  758.      BEGIN_BBOX
  759.        { ** some more primitives here ** }
  760.      END_BBOX
  761.    END_BBOX
  762.  
  763.    NAME = OBJECT_2
  764.    BEGIN_BBOX
  765.      { ** more primitives ** }
  766.    END_BBOX
  767.  
  768.  END_INSTANCES
  769.  
  770.  Restrictions:
  771.  
  772.  There can be only one BEGIN_INSTANCES statement.
  773.  There must be a matching END_INSTANCES statement.
  774.  
  775.  See also: END_INSTANCES, INSTANCE_OF
  776.  
  777.  
  778. END_INSTANCES:
  779.  
  780.  Command type : OPTIONAL
  781.  
  782.  This command specifies the end of the instance tree. Any primitive after
  783. the END_INSTANCES statement are actually displayed as part of the image.
  784.  
  785.  Restrictions:
  786.  
  787.  There can be only one END_INSTANCES statement.
  788.  
  789.  See Also: BEGIN_INSTANCES, INSTANCE_OF
  790.  
  791.  
  792. INSTANCE_OF:
  793.  
  794.  Command type: OPTIONAL
  795.  
  796.  After an instance tree is defined with the BEGIN_INSTANCES, END_INSTANCES
  797. command pair, parts of the tree can be referred to with the INSTANCE_OF
  798. statement. This actually puts the sub-tree in the image. You must specify
  799. the name of the root of the sub-tree. The original instance should be
  800. defined relative to (0,0,0), and the location parameter specifies where the
  801. new copy will go.
  802.  
  803.  Parameters (required):
  804.  
  805.  name = string  : name of sub-tree
  806.  loc  = (x,y,z) : location for instance
  807.  
  808.  Parameters (optional):
  809.  
  810.  scale = (x,y,z) : scale factor
  811.  
  812.  Example:
  813.  
  814.  INSTANCE_OF ( name = OBJECT_1,
  815.                loc = (100.23, 20.23, 45.678),
  816.                scale = (.5, .5, .5)
  817.              )
  818.  
  819.  Optional forms:
  820.  
  821.  'loc' = 'pos' = 'location' = 'position'
  822.  
  823.  Restrictions:
  824.  
  825.  All scale factor entries should be greater than zero.
  826.  
  827.  If the scale factor entries are unequal, some primitives in the instance
  828. will not be affected correctly. For example, a SPHERE will remain round if
  829. scaled by (1,2,3), not change to a QUADRATIC spheroid.
  830.  
  831.  See also : BEGIN_INSTANCES, END_INSTANCES
  832.  
  833.  
  834. Setting Defaults
  835.  
  836.  
  837. DEFAULT:
  838.  
  839.  Command type: OPTIONAL
  840.  
  841.  QRT sets certain defaults for the color attributes of a surface. The
  842. standard default is for a white, non reflective, non shiny, non transparent
  843. surface with a medium amount of dithering. These defaults can be changed
  844. with the DEFAULT command. More than one DEFAULT command can be included, in
  845. which case each one affects all primitives after it and before the next
  846. DEFAULT or the end of the file. In addition to new surface characteristics,
  847. the NO_SHADOW keyword instructs QRT not to compute shadow information for
  848. the scene. This can decrease image generation time at the expense of image
  849. quality. X and Y resolution and image aspect ratio can be set in the DEFAULT
  850. command. If they are set more than once, the values from the last DEFAULT
  851. command are taken.
  852.  
  853.  The aspect ratio for any monitor can be determined as follows:
  854.  
  855.  aspect ratio = (XR/XD)/(YR/YD)
  856.  
  857.  where:
  858.  
  859.  XR = X resolution of monitor
  860.  XD = width of monitor in arbitrary units
  861.  
  862.  YR = Y resolution of monitor
  863.  YD = height length of monitor in arbitrary units
  864.  
  865.  Parameters (optional):
  866.  
  867.  no_shadow : QRT will not compute
  868.              shadow information
  869.  
  870.  threshold = p : QRT will stop tracing
  871.                  reflected or transmitted
  872.                  rays when they reach this
  873.                  percent of their original
  874.                  intensity.
  875.  
  876.  x_res = p : X image resolution. Any
  877.              command line arguments
  878.              override this parameter.
  879.  
  880.  x_res = p : Y image resolution. Any
  881.              command line arguments
  882.              override this parameter.
  883.  
  884.  aspect = p : image aspect ratio. This
  885.               is computer and resolution
  886.               dependent.
  887.  
  888.  amb      = (r,g,b) : ambient light
  889.  diff     = (r,g,b) : diffuse reflection
  890.  trans    = (r,g,b) : transmission
  891.  density  = (r,g,b) : light attenuation
  892.  mirror   = (r,g,b) : mirror reflection
  893.  fuzz     = i       : currently unused
  894.  index    = p       : index of refraction
  895.  dither   = i       : dithering
  896.  sreflect = p       : Phong specular refl. coeff.
  897.  reflect  = p       : percent specular reflection
  898.  
  899.  Example:
  900.  
  901.  DEFAULT ( no_shadow,       { * no shadowing * }
  902.            diff = (1, 0, 0) { * default = red objects * }
  903.  
  904.            x_res = 1280,    { ** BIG image ** }
  905.            y_res = 1024,
  906.            aspect = .89
  907.          );
  908.