POV-Ray : Newsgroups : povray.general : Status of Moray? : Re: New SDL for POVRay Server Time
13 Jul 2025 11:33:12 EDT (-0400)
  Re: New SDL for POVRay  
From: Ger
Date: 19 Sep 2007 13:16:01
Message: <46f15951@news.povray.org>
Zeger Knaepen wrote:

> "Nicolas George" <nicolas$george@salle-s.org> wrote in message
> news:46f1088f$1@news.povray.org...
>> use Colors;
>>
>> scene [
>>
>>  camera [
>>    location => [ 2, 5, -3 ],
>>    look_at => [ 0, 0, 0 ]
>>  ],
>>
>>  light_source [
>>    [ 0, 10, -2 ],
>>    White
>>  ],
>>
>>  union [
>>    box [
>>      [ -1, -1, -1 ], [ 1, 1, 1 ],
>>      pigment => Red
>>    ],
>>    sphere [
>>      [ 0, 1.5, 0 ], 0.5
>>      pigment => Yellow
>>    ]
>>  ]
>>
>> ]
> 
> I prefer the current syntax actually. All the commas after ] seem
> completely redundant, the keyword scene is a nice idea if it would be
> possible to define multiple scenes in one file, but it should be optional.
> The line "use Colors;" seems completely out of place for two reasons:
> first, Colors what? Colors.inc ? Colors.pov ? ..? second, considering the
> rest of the syntax, wouldn't something like "include
> [colors.inc,textures.inc]" be more consistent?
> 
> I also don't like the change from curly brackets to square brackets.
> 
> Actually I think a new SDL should look more or less the same as the old
> one, ie. a C-like syntax, but with some new things, like cleaner syntax,
> OO, ... For example: instead of '#declare X=1;' you would have something
> like 'float X=1;' (I don't think there's need for both int and float,
> since, afaik internally it's all floats).

If vars are defined as float then why the need to define them as such? On
the other hand, integers are much faster so why not use both?

> 
> However, there are many things in the current SDL that I actually like,
> although they might be considered weird by programmers.
> For example, maybe it would be cleaner to have something like:
> 
> Camera ActiveCamera = new Camera();
> ActiveCamera.location = new Vector(0,0,1);
> ActiveCamera.lookAt = new Vector(0,0,0);
> 
> But it's a lot easier, especially for non-programmers, the way it is now:
> 
> camera {
>     location z
>     look_at 0
> }
> 
> But well, I suppose making a cleaner, stricter syntax will always lead to
> having a more difficult to learn syntax :(
> 
> cu!

-- 
Ger


Post a reply to this message

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