|
![](/i/fill.gif) |
David Buck wrote:
> Warp wrote:
>> Fa3ien <fab### [at] yourshoes skynet be> 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?
Yes something like that. Not sure about the need for a stack here.
And I would suggest not to include the camera *in* the scene but have a
scene description and an output device, that may or may not be a camera,
that gets the scene as input.
Post a reply to this message
|
![](/i/fill.gif) |