POV-Ray : Newsgroups : povray.programming : real scripting in povray? : real scripting in povray? Server Time
28 Jul 2024 20:28:25 EDT (-0400)
  real scripting in povray?  
From: Anders Haglund
Date: 29 May 1999 10:02:52
Message: <374fe57c.0@news.povray.org>
Hi everybody!

I wonder if anyone has thought about doing a better way to do large scripts
in povray?
I've been thinking about it a lot lately, getting pretty bored with #macro's
where 90% of the code is diffrent #declare statements.
There realy should be a light C++ interpeter in povray. Nothing fancy, just
the basic statements, for(;;), while(), do..while() and so on. And when you
actualy want to create something you write something like:

cout << " sphere { <0,0,0>,1 } " << endl;

to output it to the temporary scene source file. This could also be used for
messages:

cout << debug << "X position: " << x << endl;

to output a debug message.

A snip from a small scene could look something like this:

#script
    float x = 0;
    for (int i = 0;i < 10;i++) {
        cout << "sphere {<" << x << ",0,0>,1" << endl;
        cout << debug << "Output sphere nr." i << " at <" << x << ",0,0>" <<
endl;
        x += 3;
    }
#end

An implementation with procedures would be nice to.

Well, food for thought anyway.

/Anders


Post a reply to this message

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