POV-Ray : Newsgroups : povray.general : Object oriented Povray? (Modifying existing objects) : Re: Object oriented Povray? (Modifying existing objects) Server Time
2 Aug 2024 00:19:37 EDT (-0400)
  Re: Object oriented Povray? (Modifying existing objects)  
From: Ross
Date: 28 Feb 2005 18:17:21
Message: <4223a681$1@news.povray.org>
"ekolis" <kol### [at] fusenet> wrote in message
news:web.4223902ef4bf0e27820779d30@news.povray.org...
> I know you can use #declare statements to create reusable objects, but is
> there any way to modify individual instance once they've been
instantiated?
> Or is that not a feature of the language at this point? I'm thinking of
> something like this:
>
> #declare ball = sphere
> {
>  // basic ball attributes go here
> }
>
> ball ball1, ball2, ball3
> ball1.translate<0,1,0>
> ball2.pigment = rgb<1,0,0>
> ball3.scale<10,10,10>
>
> Apologies for the poor syntax; I haven't worked much with raw Povray code
> lately!
>
>

#declare ball = sphere {
 1, <0, 1, 0>
 pigment {rgb <1, 0, 0>}
 //... and so on
}

object {
 ball
 translate <0, 1, 0>
}

object {
 ball
 pigment {rgb <1, 0, 0>} //not sure that this will override the pigment
statement in the #define'd ball
}

object {
 ball
 scale <10, 10, 10>
}


anyway, is that what you were asking?


Post a reply to this message

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