The applysurf keyword may be used to set the default surface
characteristics for the aggregate object currently being defined.
- applysurf <Surface Specification>
- 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.
/*
* Mirrored ball and cylinder sitting on 'default' plane.
*/
surface mirror ambient .01 .01 .01 diffuse .05 .05 .05
specular .8 .8 .8 specpow 20 reflect 0.95
plane 0 0 0 0 0 1
applysurf mirror
sphere 1 0 0 0
cylinder 1 3 0 0 3 0 3
For convenience, the name cursurf may be used to refer to the current
default surface.
The utility of bottom-up binding of surfaces lies in the fact that one
may be as adamant or as non-committal 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.
surface white ...
surface black ...
surface gold ...
...
name cross list
box x y z x y z
...
end
name king list
triangle x y z x y z x y z
...
object gold cross
end
object white king translate 1. 0 0
object black king
Footnotes