home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / prt / spec / prt.txt
Text File  |  1994-06-01  |  6KB  |  243 lines

  1.  
  2.                            PRT INPUT FILE FORMAT
  3.                                  Version 1.0
  4.                         Copyright (C) Kory Hamzeh, 1990.
  5.  
  6. Initially prt used the NFF file format. Then I started adding features to it,
  7. and decided not to call it NFF since it wasn't NFF anymore (makes sense,
  8. doesn't it?).
  9.  
  10. Here is a list of keywords:
  11.  
  12.     from
  13.     at
  14.     up
  15.     angle
  16.     resolution
  17.     light
  18.     background
  19.     surface
  20.     cone
  21.     sphere
  22.     hsphere
  23.     polygon
  24.     ring
  25.     quadric
  26.     instance
  27.     end_instance
  28.     instance_of
  29.  
  30. Here is an explanation of each keyword:
  31.  
  32. ----------
  33.  
  34. Each input file must begin with the following keywords:
  35.  
  36.     from %g %g %g
  37.     at %g %g %g
  38.     up %g %g %g
  39.     angle %g
  40.     resolution %d %d
  41.  
  42. The parameters are:
  43.  
  44.     From:  the eye location in XYZ.
  45.     At:    a position to be at the center of the image, in XYZ world
  46.        coordinates.  A.k.a. "lookat".
  47.     Up:    a vector defining which direction is up, as an XYZ vector.
  48.     Angle: in degrees, defined as from the center of top pixel row to
  49.        bottom pixel row and left column to right column.
  50.     Resolution: in pixels, in x and in y.
  51.  
  52. ----------
  53.  
  54. Light sources:
  55.  
  56.     light X Y Z
  57.  
  58. Format:
  59.  
  60.     light %g %g %g
  61.  
  62. This keyword defines the position of the light sources. All light sources
  63. must be defined before any objects are defined.
  64.  
  65. ----------
  66.  
  67. Background color:
  68.  
  69.     background R G B y
  70.  
  71. Format:
  72.  
  73.     background %g %g %g y
  74.  
  75. The background color in RGB. The last field is used for color cueing which
  76. is not implemented yet and must always be 'y'.
  77.  
  78. ----------
  79.  
  80. Surface properties:
  81.  
  82.     surface Rr Rg Rb Ks  Fr Fg Fb T  Ar Ag Ab  Dr Dg Db  Sr Sg Sb P Ior
  83.  
  84. Format:
  85.  
  86.     surface %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g
  87.  
  88. The parameters are:
  89.  
  90.     Rr Rg Rb    The reflective color triplet. This value should always
  91.             be 1 1 1 unless you want this surface to reflect 
  92.             different percentage per color component.
  93.     Ks        The specular component. This value is the percentage
  94.             of light that is reflected from this object. A value
  95.             of 0 means no reflection, and a value of 1 means a 
  96.             perfect reflector (mirror).
  97.     Fr Fg Fb    The refractive color triplet. This value should always
  98.             be 1 1 1 unless you want this surface to refract
  99.             different percentage per color component.
  100.     T        Transparency value. The amount of light that can go
  101.             through this object. A value of 0 means a totally opaque
  102.             object. A value of 1 means a totally transparent object.
  103.     Ar Ag Ab    The ambient color for this object. This means the color
  104.             of an object if it were fully shadowed. All objects are
  105.             assigned this color before any shading algorithm is
  106.             started. 
  107.     Dr Dg Db    The diffuse color component.
  108.     Sr Sg Sb    This value is the color of the specular highlights.
  109.             Usually it should be 1 1 1.
  110.     P        The Phong cosine power for highlights. The higher the
  111.             number (for example 100), the smaller the highlight.
  112.     Ior        Index of refraction.
  113.  
  114. ---------
  115.  
  116. Cylinder or cone:
  117.  
  118.     cone
  119.     base.x base.y base.z base_radius
  120.     apex.x apex.y apex.z apex_radius
  121.  
  122. Format:
  123.  
  124.     cone
  125.     %g %g %g %g
  126.     %g %g %g %g
  127.  
  128.  
  129. --------
  130.  
  131. Sphere:
  132.  
  133.     sphere center.x center.y center.z radius
  134.  
  135. Format:
  136.  
  137.     sphere %g %g %g %g
  138.  
  139.  
  140. --------
  141.  
  142. Hollow sphere:
  143.  
  144.     sphere center.x center.y center.z radius thickness
  145.  
  146. Format:
  147.  
  148.     sphere %g %g %g %g %g
  149.  
  150. --------
  151.  
  152. Polygon:  A polygon is defined by a set of vertices.  With these databases,
  153.     a polygon is defined to have all points coplanar.  A polygon has only
  154.     one side, with the order of the vertices being counterclockwise as you
  155.     face the polygon (right-handed coordinate system).  The first two edges
  156.     must form a non-zero convex angle, so that the normal and side 
  157.     visibility can be determined.  Description:
  158.  
  159.     polygon total_vertices
  160.     vert1.x vert1.y vert1.z
  161.     [etc. for total_vertices vertices]
  162.  
  163. Format:
  164.  
  165.     polygon %d
  166.     [ %g %g %g ] <-- for total_vertices vertices
  167.  
  168. --------
  169.  
  170. Ring:
  171.     A ring is a flat coplaner round shaped object. For a ring object,
  172.     you must specify the center, 2 points on the surface of the ring,
  173.     the inner radius, and the outer radius. If the inner radius is non-zero,
  174.     then the ring will have a hole in the middle with the given radius.
  175.  
  176.     ring center.x center.y center.z p1.x p1.y p1.z p2.x p2.y p2.z or ir
  177.  
  178. Format:
  179.  
  180.     ring %g %g %g  %g %g %g  %g %g %g  %g  %g
  181.  
  182. ----------
  183.  
  184. Quadratic:
  185.  
  186.     You can raytrace any quadratic object by specifying the center,
  187.     min, max, and coefficients. This is a very powerful object type.
  188.     It can do ellipsoids, hyperbolas, and any other quadratic surface.
  189.  
  190.     quadric center.x center.y center.Z
  191.     min.x min.y min.z max.x max.y max.z
  192.     a b c d e 
  193.     f g h i j
  194.  
  195.     The fields "a" through "j" are the coefficients.
  196.  
  197. Format:
  198.  
  199.     quadric %g %g %g
  200.     %g %g %g  %g %g %g
  201.     %g %g %g %g %g
  202.     %g %g %g %g %g
  203.  
  204. ----------
  205.  
  206. Object instances.
  207.  
  208. Defining an object instance:
  209.  
  210.     You may define a group of objects (and surface properties) to an 
  211.     instance and assign a name to that instance. When the instance
  212.     is then used, all the objects in that instance will be placed
  213.     relative to the given origin. Note that instances by themselves
  214.     do not create any objects; the objects are created when the 
  215.     instance is referenced. Instances can not be nested.
  216.  
  217.     Instances are used as follows:
  218.  
  219.         instance nameofthisinstance
  220.  
  221.             [ objects and surface properties ]
  222.  
  223.         end_instance
  224.  
  225.     where "nameofthisinstance" is a user assigned name such
  226.     as, for example, "tile_pattern".
  227.  
  228.     An instance is referenced as follows:
  229.  
  230.         instance_of nameofinstance loc.x loc.y loc.z
  231.  
  232.     where
  233.  
  234.         nameofinstance is the name assigned to a previously
  235.         defined object instance.
  236.         loc.x, loc.y, loc.z, the location of this object group.
  237.  
  238.  
  239. ----------
  240.  
  241.                        ** END OF DOCUMENT **
  242.  
  243.