home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / raysh402 / guide.tex / node32_mn.html < prev    next >
Text File  |  1992-02-09  |  3KB  |  86 lines

  1.  
  2. <H1><A ID="SECTION00840000000000000000">
  3. Surface Specification</A>
  4. </H1>
  5.  
  6. <P>
  7. <#640#><#2011#><EM>Rayshade</EM><#2011#><#640#> provides a number of ways to define surfaces and to
  8. bind these surfaces to objects.  The most straight-forward method
  9. of surface specification is to simply list the surface properties to
  10. be used.
  11. Alternatively, one may associate a name with a given surface.
  12. This name may subsequently be used to refer to that surface.
  13.  
  14. <P>
  15. <DL>
  16. <DT><STRONG><#4971#><#4971#></STRONG></DT>
  17. <DD><#1468#><TT>surface</TT><#1468#> <#1469#><EM>name</EM><#1469#> ;SPMlt;<#1470#><EM>Surface Definition</EM><#1470#>;SPMgt; 
  18. <BR>    Associate the given collection of surface attributes with the
  19.     given name.
  20. </DD>
  21. </DL>
  22. <P>
  23. The binding of a collection of surface properties to a given object
  24. is accomplished in a bottom-up manner; the surface that ``closest''
  25. in the modeling tree to the primitive being rendered is the one that
  26. is used to give the primitive its appearance.
  27.  
  28. <P>
  29. An object that has no surface bound to it is assigned a default surface
  30. that gives the appearance of white plastic.
  31.  
  32. <P>
  33. The
  34. most direct way to bind a surface to a primitive
  35. is to specify the surface when the
  36. the primitive instantiated.
  37. This is accomplished
  38. by inserting a list of surface attributes or a surface name after
  39. the primitive's type keyword and before the actual primitive data.
  40.  
  41. <P>
  42. <PRE><tex2html_verbatim_mark>verbatim42#</PRE>
  43.  
  44. <P>
  45. Here, we define a red surface named ``mud''.  We then instantiate
  46. a sphere, which has a diffuse white surface bound to it.  The
  47. next line instantiates a sphere with the defined ``mud'' surface bound
  48. to it.  The last line instantiates a sphere with no surface bound to it;
  49. it is assigned the default surface by <#648#><#2013#><EM>rayshade</EM><#2013#><#648#>.
  50.  
  51. <P>
  52. The <#649#><TT>applysurf</TT><#649#> keyword may be used to set the default surface
  53. characteristics for the aggregate object currently being defined.
  54.  
  55. <P>
  56. <DL>
  57. <DT><STRONG><#4974#><#4974#></STRONG></DT>
  58. <DD><#1473#><TT>applysurf</TT><#1473#> ;SPMlt;<#1474#><EM>Surface Specification</EM><#1474#>;SPMgt; 
  59. <BR>The specified surface is applied to all following
  60. instantiated objects that do not have surfaces associated with them.
  61. The scope of this keyword is limited to the aggregate currently
  62. being defined.
  63. </DD>
  64. </DL>
  65. <P>
  66. <PRE><tex2html_verbatim_mark>verbatim43#</PRE>
  67.  
  68. <P>
  69. For convenience, the name <#656#><TT>cursurf</TT><#656#> may be used to refer to the
  70. current default surface.
  71.  
  72. <P>
  73. The utility of bottom-up binding of surfaces lies in the fact that
  74. one may be as adamant or as noncommittal about
  75. surface binding as one sees fit when defining objects.  For example,
  76. one could define a king chess piece consisting of triangles that have no
  77. surface bound to them, save for the cross on top, which has
  78. a gold-colored surface associated with it.  One may then instantiate
  79. the king twice, once applying a black surface, and once applying
  80. a white surface.  The result:  a black king and a white king, each
  81. adorned with a golden cross.
  82.  
  83. <P>
  84. <PRE><tex2html_verbatim_mark>verbatim44#</PRE>
  85. <tex2html_image_mark>#center4977#
  86.