POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 06:25:26 EDT (-0400)
  Re: Object Oriented POV code  
From: andrel
Date: 18 Feb 2004 18:42:37
Message: <4033F831.1020806@hotmail.com>
Dan P wrote:

> "Tom Melly" <pov### [at] tomandlucouk> wrote in message
> news:4033cd07@news.povray.org...
> 
>>andrel wrote:
>>
>>
>>>is better left out. At this point I cannot judge very well because I
>>>still have no good perception of how an OOPOV would look, but perhaps
>>
>>There's a challenge... Warp? What would, IYHO, a bit of Pov-OO look like?
> 
> 
> I'm sorry; I know you didn't ask me. I have some ideas of how it could look:
> 
> 
> object ColoredSphere (v, c) inherits Sphere
> {
>     pigment
>     {
>         color = c
>     }
> }
> 
> object red_sphere = new ColoredSphere (<1, -2, 3>, new Color(1, 0, 0))
> object green_sphere = new ColoredSphere (<2, -2, 3>, new Color(0, 1, 0))
> 
> show red_sphere
> show green_sphere

I do not see why the current syntax with macros does not suffice here.

> 
> Off the top of my head, I could see this being useful. You could also do
> this:
> 
> red_sphere.pigment.color = new Color.White
Well if it allows you to have an object that is called red_sphere but
is actually white then we are in deep trouble.

Just kidding, I understand what you mean. My first reaction would be
that pigments can be much more complicated than just a simple color.
That is what POV makes exciting. I do not immediately see how you can
handle that complexity in a understandable way. I will think about that
(later).


Post a reply to this message

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