POV-Ray : Newsgroups : povray.programming : real scripting in povray? : Re: real scripting in povray? Server Time
29 Jul 2024 02:29:50 EDT (-0400)
  Re: real scripting in povray?  
From: Brad S  Freeman
Date: 1 Jun 1999 08:22:29
Message: <3753c275.0@news.povray.org>
Hi,

I think everything programmable which is added to POV-Ray should be
*optional*. You must simply look for a way to link a greater flexibility
(which is more complex) to the (relative) simplicity of the existing
language.
What I concretely mean is: You write script files in an easy interpreted
language ("pov script"?), and then you link them into your pov file. In the
script you may be able to access certain objects by name and change their
properties. This leads to the fact that you have to provide names for the
objects in the scene (if you want to use scripts, that is).

Here an example:

1. The pov scene file
#include "colors.inc"
...
#include "script.scr"
...
sphere {
  name "MySphere"
  <0, 0, 0>, 1
  pigment { Red }
}

2. The script file:
...
MySphere.center.x = 0.5;
MySphere.radius = a;
...
MyLightSource.media_attenuation = false;
etc.

The disadvantage is that a wholly new object structure would have to be
designed, since most object properties are not explicitly called by a name
but just written down, say the radius of a sphere.

That's it for today: Brad


Post a reply to this message

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