POV-Ray : Newsgroups : povray.general : Attempt to POV4 Syntax basics : Re: Attempt to POV4 Syntax basics Server Time
31 Jul 2024 12:20:57 EDT (-0400)
  Re: Attempt to POV4 Syntax basics  
From: Bruno Cabasson
Date: 6 Oct 2007 19:45:01
Message: <web.47081ce0153c00f690965fe80@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.