POV-Ray : Newsgroups : povray.general : POV 4 ideology proposal : Re: POV 4 ideology proposal Server Time
29 Jul 2024 22:32:08 EDT (-0400)
  Re: POV 4 ideology proposal  
From: Mikael Carneholm
Date: 13 Apr 1999 09:49:22
Message: <37133CB5.65E05B4@ida.utb.hb.se>
Roland Mas wrote:

 Yes, of course.  Replace every single parameter with a function

> call.  You call that readability?  And small?
>
> Sphere Left_Eye_Ball is
>   Radius : Float := 1.0;
>   Center : Vector3 := <0.0,0.0,0.0>;
>   Texture := new Texture_Type;
>   Texture.Pigment := new Pigment_Type;
>   Texture.Pigment.Type := Bozo;
>   Texture.Pigment.Turbulence := new Map_Type;
>   Texture.Pigment.Turbulence.Type := Gradient;
>   Texture.Pigment.Turbulence.Direction := <1.0,0.0,0.0>;
>   Texture.Pigment.Turbulence.Map := new Map;
> [...]
> end Sphere;
>

No, no, no.....this is not what it should be like. Look, I bet you have done
this a couple of times:

#declare SomeSphere=sphere{
    <0,0,0>, 0.5
    pigment{color rgb <1,0,0>}
}

object{
    SomeSphere
    // added rotations, tranlations etc.
}

This is already pretty close to OO scripting!  (SomeSphere is the "class" and
it is instanced with object{})
Now, what we can't do with the current version is this:

#declare SomeSphere.position=SomeSphere.position+<0,1,0>;
#declare SomeSphere.radius=1.5;
#declare SomeSphere.pigment=pigment{color rgb<0,0,1>};

This could be very useful.

AND, it should be fully backwards compatible with previous versions (1-3),
i.e, you should still be able to do like this...

sphere{
    <0,0,0>, 0.5
    pigment{color rgb <1,0,0>}
}

...to see a red sphere render on your screen (as the "instant" instance of
the "class" sphere{} it actually is, when you think of it...).
It's only, it would be nice to be able to access the different attributes via
dot(.) notation.

POV scripting has always been a simplified programming language - let's keep
it so.
Introducing OO scripting in POV should be done in the same spirit - powerful,
yet simplified.
POV spirit. THE spirit.

Regards,

- Mikael.

-----------------------------------------------------------------
Mikael Carneholm
Dep. of Computer Science


http://www.studenter.hb.se/~arch
E-mail: sa9### [at] idautbhbse


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

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