POV-Ray : Newsgroups : povray.general : POV-CSDL (or Java Binding?) : Re: POV-CSDL (or Java Binding?) Server Time
10 Aug 2024 13:25:40 EDT (-0400)
  Re: POV-CSDL (or Java Binding?)  
From: Johannes Hubert
Date: 12 Mar 2000 17:15:38
Message: <38cc170a@news.povray.org>
Chris: Have you thought about adding CSDL directly into a patched
version of POV-Ray?

Like some sort of preprocessor.

A POV-Script could for example look like this:

#include "colors.inc"
#include "textures.inc"

camera {
    // whatever...
}

background { color MidnightBlue }

plane {
    // whatever...
}

// etc.

#begin_csdl
// CSDL code
// (in a yet to be defined syntax)
// goes here...
#end_csdl

sphere {
    // whatever
}

#begin_csdl
// some more
// CSDL code here...
#end_csdl

box {
    // whatever
}

// etc.


The pached version would then first scan the script for "#begin_csdl ...
#end_csdl" blocks (in all include-files too) and would "translate" them
to real POV-script and replace the blocks with their corresponding
POV-script code. The resulting script would then be handed to the
standard POV-parser, who would never even see (or know about) the CSDL
code.

Users that don't want to use the CSDL code don't have to. And usage of a
plugin written in CSDL would be nothing more than an "#include"
statement, where the whole "#begin_csdl" etc. would be in the include
file.

One small problem: Parsing will be slower, since first the CSDL code
needs to be parsed and translated, before finally POV-ray has to parse
the result.
However, a caching scheme to re-use the translation of previously parsed
and unchanged CSDL blocks could certainly be implemented.

Johannes


Post a reply to this message

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