POV-Ray : Newsgroups : povray.general : Attempt to POV4 Syntax basics : Re: Attempt to POV4 Syntax basics Server Time
31 Jul 2024 10:18:11 EDT (-0400)
  Re: Attempt to POV4 Syntax basics  
From: David Buck
Date: 10 Oct 2007 21:34:38
Message: <470d7dae$1@news.povray.org>
andrel wrote:
> Fa3ien wrote:

>>
>>>   Thus all you who are worrying about the "new SDL" being some cryptic
>>> high-end programming language only a few can understand, you have got
>>> it completely wrong: Keeping the current ease-of-use and, as far as
>>> possible, the same syntax, is a *major* concern in the designing of
>>> the new SDL. You don't have to express your concern about this.
>>
>> All these threads have precisely shown that there ARE people who would
>> like POV-Ray to be driven by some high-end language (trough an API
>> or whatever).
>>
> There might be but david's wasn't one. He mere pointed out how the 
> existing SDL could be transformed *internally* to an OO type of language 
> that could be parsed and executed like one.

Correct.  This proposal would keep the same SDL (again, possibly without 
macros as they currently exist) and internally translate it into 
objects.  Whether or not it actually generates code in an OO language is 
an implementation detail.  It can be done without any code generation at 
all and, in fact, I think this is the best approach.

I should also point out that POV-Ray should be split into three layers.

	1) The low-level rendering engine with an API
	2) The SDL which reads the scenes and calls the renderer through the API
	3) A Moray-like modeler which (likely) produces SDL

#3 could also talk directly to the rendering API but I think you'd lose 
some power and flexibility that way.

The strange thing about my proposal is that the SDL can actually extend 
the low-level engine.  If you want a sphere, call the low-level API to 
create one.  If you want a NURB (Non-Uniform Rational B-Spline), code it 
in the SDL layer, provide methods that do ray-surface intersection, 
normal calculation, etc, and use it. The low level renderer would treat 
it just like a primitive shape but call into the SDL layer to do the 
calculations.  The same applies to new kinds of pigments, finishes, etc.

The rendering of NURBS may be a bit slower depending on how the SDL 
layer is written, but that doesn't stop you from extending the base 
renderer.  POV-Ray is already partially object-oriented (and has been 
since DKBTrace was first released in 1986).  That OO nature should work 
seamlessly between the low-level rendering layer and the SDL layer.

Just to be clear, NURBS or new pigments or finishes would likely not be 
coded in the SDL syntax itself but in the OO language that accompanies 
the SDL.  For example, I can have some methods written in the SDL 
modeling language that we know and love and others written in, for 
example, Smalltalk.  That's where I'm developing some prototypes of this 
technique.

David Buck


Post a reply to this message

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