POV-Ray : Newsgroups : povray.general : Attempt to POV4 Syntax basics : Re: Attempt to POV4 Syntax basics Server Time
31 Jul 2024 12:26:47 EDT (-0400)
  Re: Attempt to POV4 Syntax basics  
From: Alain
Date: 9 Oct 2007 09:52:39
Message: <470b87a7$1@news.povray.org>
David Buck nous apporta ses lumieres en ce 2007/10/09 07:39:
> Warp wrote:
>> Fa3ien <fab### [at] yourshoesskynetbe> wrote:
>>> POV-Ray allows you to do that, not as a side-effect of the SDL, but
>>> precisely BY DESIGN.  Drop that, and you kill POV-Ray (there are
>>> already many nice and free pure renderers out there).
>>
>> 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.
>>
>>   (Of course a different issue is whether there's enough manpower and
>> expertise to actually develop and implement such a language.)
>>
> 
> When I have a few minutes here and there, I'm working on a technique 
> which retains the current SDL (with the possible exception of macros as 
> they currently exist) but makes it user-expandable.  The POV SDL syntax 
> doesn't need to be the huge complex thing that it appears to be.  For 
> example, consider the following snippet of SDL:
> 
> camera {
>    location <-5, 10, -15>
>    direction <0, 0,  2.25>
>    right x*1.33
>    look_at <0,0,0>
> }
> 
> sky_sphere {
>     pigment {
>         gradient y
>         color_map {
>             [0, 1  color Gray50 color Gray80]
>         }
>     }
> }
> 
> The parts of the syntax would include things like 1.33, <-5, 10, -15>, 
> {} and []. The rest of the identifiers name methods written in either 
> the SDL itself or a high level programming language.
> 
> The semantics would be something like:
> 
> camera
>     - call the camera method to:
>         - create an instance of a camera
>         - add it to the scene
> {
>     - push it on the stack
> 
> location
>     - call the location method to:
>         - expect a vector parameter to follow
>         - apply to the top of stack (the camera)
> 
> }
>     - pop the stack
> 
> 
> sky_sphere
>     - call the sky_sphere method to:
>         - create a sky_sphere
>         - add it to the scene
> {
>     - push it on the stack
> 
> pigment
>     - call the pigment method to:
>         - create a new pigment
>         - apply it to the sky sphere
> {
>     - push the pigment on the stack
> 
> etc...
> 
> The words like camera, location, pigment, and so forth are no longer 
> part of the syntax - they are methods that are called by the parser.  To 
> add new functionality, you can add new methods which can be written in 
> either SDL or the high level programming language.
> 
> It seems to me like the whole SDL grammar can be modelled this way which 
> would give backwards compatibility as well as expandability.
> 
> 
> Thoughts?
> 
> David Buck
As long as it's transparent to the user. That is, the user don't see it unless 
he want to.

-- 
Alain
-------------------------------------------------
Never frown, even when you are sad, because you never know who is falling in 
love with your smile.


Post a reply to this message

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