|
|
/*
Author: Nathan Kopp
Date: Feb 26, 2000
This example demonstrates run-time scoping using the POV scripting language.
If you don't understand the term 'scope', then just ignore this message. It
is posted here for a discussion in povray.unofficial.patches.
The call to makesph() will generate a while sphere. The call to makesph2
will generate a red sphere. The variable 'col' is resolved differently
depending on where and when the macro is called.
*/
#version 3.1;
camera
{
location <0.0, 0.5, -4.0>
look_at <0.0, 0.0, 0.0>
}
sky_sphere
{
pigment
{
gradient y
color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
}
}
light_source
{
<-30, 30, -30> color rgb 1
}
#macro makesph()
sphere { 0.0, 1
texture {
pigment { rgb col }
finish{specular 1}
}
}
#end
#macro makesph2()
#local col = <1,0,0>
makesph()
#end
#declare col=<1,1,1>;
object{
makesph2()
translate -x
}
object{
makesph()
translate x
}
Post a reply to this message
|
|