POV-Ray : Newsgroups : povray.programming : PROOF : Pov Ray Object Oriented Features : an attempt on classes in Sdl : Re: PROOF : Pov Ray Object Oriented Features : an attempt on classes in Sdl Server Time
1 Dec 2022 18:11:01 EST (-0500)
  Re: PROOF : Pov Ray Object Oriented Features : an attempt on classes in Sdl  
From: jr
Date: 1 Mar 2022 12:35:00
Message: <web.621e5803dad3a7bbed36e5cb6cde94f1@news.povray.org>
hi,

"Bruno Cabasson" <bru### [at] cabassoncom> wrote:
> [sorry, I pressed the 'post message' by accident ...]
> Hi There!

just a couple of comments and questions.


> ...
> After having #include'ed the appropriate definitions (currently, I have :
> primitives.inc, collections.inc, oocore.inc for the basic OO featues),

I've re-read the post a couple of times, am curious about and try to wrap my
head round the .. substance.  I think it would be very helpful if you could post
a zip with the includes and two or three demonstrations of the OO features,
aimed perhaps at the (snipped, sorry) "3D artists".


> I can write this, as a syntactic example without any other interest :
>
> [START]
> // == class MyClass =========================
> #declare MyClass = class
> (
>     "MyClass", // Name of the class
>     no,        // No parent class
>     None,
>     array      // properties
>     {
>         array mixed {"property1", TYPES._int_},
>         array mixed {"property2", TYPES._string_}
>     },
>     array    // Methods
>     {
>         "method1",
>         "method2"
>     }
> )
> ... here is a code fragment :
> describe(Sphere,)
> #declare my_sphere = new
> (
>     Sphere,,
>     dictionary {.center : 1.2*x, .radius_ : 1}
> )
> setmods
> (
>     my_sphere,
>     dictionary
>     {
>         .texture_ : pigment {Red},
>     }
> )
> setfinish(my_sphere, finish {specular 0.8 roughness 0.002})
> setnormal(my_sphere, normal {crackle 2 scale 0.3})
> dump(my_sphere,)
> spawn(my_sphere)
> dump(my_sphere,)
>
> And let there be the sphere !!

Q - what is the state of the documentation?  because the above isn't exactly
"self-descriptive", I feel I'd want a (detailed) reference to hand.

also, as a potential user I think that's a lot of code to go from object
creation to the "instance".  perhaps the raw OO syntax could/should be hidden
inside wrappers ("syntactic sugar" :-)).


> As such, classes for object have no real interest if you just drop objects in
> your scene. But, with classes and object-orientedness, one can go further and
> implement behaviours, design pattens ...
>
> This post was quite long, therefore, I'll tell more in a next one.

please.  and some "hands-on" example code perhaps?


regards, jr.


Post a reply to this message

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