home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
tt
/
raysh402
/
guide.tex
/
node32_mn.html
< prev
next >
Wrap
Text File
|
1992-02-09
|
3KB
|
86 lines
<H1><A ID="SECTION00840000000000000000">
Surface Specification</A>
</H1>
<P>
<#640#><#2011#><EM>Rayshade</EM><#2011#><#640#> provides a number of ways to define surfaces and to
bind these surfaces to objects. The most straight-forward method
of surface specification is to simply list the surface properties to
be used.
Alternatively, one may associate a name with a given surface.
This name may subsequently be used to refer to that surface.
<P>
<DL>
<DT><STRONG><#4971#><#4971#></STRONG></DT>
<DD><#1468#><TT>surface</TT><#1468#> <#1469#><EM>name</EM><#1469#> ;SPMlt;<#1470#><EM>Surface Definition</EM><#1470#>;SPMgt;
<BR> Associate the given collection of surface attributes with the
given name.
</DD>
</DL>
<P>
The binding of a collection of surface properties to a given object
is accomplished in a bottom-up manner; the surface that ``closest''
in the modeling tree to the primitive being rendered is the one that
is used to give the primitive its appearance.
<P>
An object that has no surface bound to it is assigned a default surface
that gives the appearance of white plastic.
<P>
The
most direct way to bind a surface to a primitive
is to specify the surface when the
the primitive instantiated.
This is accomplished
by inserting a list of surface attributes or a surface name after
the primitive's type keyword and before the actual primitive data.
<P>
<PRE><tex2html_verbatim_mark>verbatim42#</PRE>
<P>
Here, we define a red surface named ``mud''. We then instantiate
a sphere, which has a diffuse white surface bound to it. The
next line instantiates a sphere with the defined ``mud'' surface bound
to it. The last line instantiates a sphere with no surface bound to it;
it is assigned the default surface by <#648#><#2013#><EM>rayshade</EM><#2013#><#648#>.
<P>
The <#649#><TT>applysurf</TT><#649#> keyword may be used to set the default surface
characteristics for the aggregate object currently being defined.
<P>
<DL>
<DT><STRONG><#4974#><#4974#></STRONG></DT>
<DD><#1473#><TT>applysurf</TT><#1473#> ;SPMlt;<#1474#><EM>Surface Specification</EM><#1474#>;SPMgt;
<BR>The specified surface is applied to all following
instantiated objects that do not have surfaces associated with them.
The scope of this keyword is limited to the aggregate currently
being defined.
</DD>
</DL>
<P>
<PRE><tex2html_verbatim_mark>verbatim43#</PRE>
<P>
For convenience, the name <#656#><TT>cursurf</TT><#656#> may be used to refer to the
current default surface.
<P>
The utility of bottom-up binding of surfaces lies in the fact that
one may be as adamant or as noncommittal about
surface binding as one sees fit when defining objects. For example,
one could define a king chess piece consisting of triangles that have no
surface bound to them, save for the cross on top, which has
a gold-colored surface associated with it. One may then instantiate
the king twice, once applying a black surface, and once applying
a white surface. The result: a black king and a white king, each
adorned with a golden cross.
<P>
<PRE><tex2html_verbatim_mark>verbatim44#</PRE>
<tex2html_image_mark>#center4977#