|
![](/i/fill.gif) |
I continue to make proposals. After class inheritance, I illustrate scene
inheritance.
File pov/scenes/BasicScene.pov4 (shipped-with stuff)
--------------------------------
package pov.scenes;
scene BasicScene
{
property sun = light_source {...} // properties of a scene can be
accessed by derived scenes
sky_sphere {...}
ground = plane {y, 0 pigment {White}} // 'White' from pov.basic.Colors
class. Package 'pov.basics' imported by default
property the_sphere = sphere
{
location 0 // 0 promoted to <0,0,0>
radius 1 // trying to see how to keep "0, 1" and current shorcuts
pigment
{
pattern radial
frequency 5
color_map {...}
}
place_on ground // Method call without parentheses.
}
}
File my_stuff.trash.BasicRSOCP.pov4
------------------------------------
package my_stuff.trash;
import pov.metals.*;
scene BasicRSOCP_ButMoreBeautiful extends BasicScene
{
ground.pigment {pattern checker color_map{...}}
the_sphere.texture = Polished_Chrome;
// The rest of the scene (sky_sphere and sun) are unchanged
}
File my_stuf.trash.BasicRSOCP_ButMoreBeautiful.pov4
---------------------------------------------------
package my_stuff.trash;
import pov.system.*;
scene BasicRSOCP_ButMoreBeautiful(date:string) extends BasicRSOCP
//date:sting --> $date?
//scene parameters from command-line?
{
// specify sun's position;
sun.sunpos(date);
// add
N = 10;
for i in 1..N
{
sphere
{
location 0
radius the_sphere.radius/10
texture {the_sphere.texture}
translate 2*the_sphere.radius*z
rotate
}
}
}
Bruno
Post a reply to this message
|
![](/i/fill.gif) |