POV-Ray : Newsgroups : povray.general : Modify already created object : Re: Modify already created object Server Time
8 Jul 2024 14:43:07 EDT (-0400)
  Re: Modify already created object  
From: Alain
Date: 28 Aug 2014 16:31:42
Message: <53ff91ae@news.povray.org>

> Is there any option how to modify some attributes of some already created
> object...like changing scale of some polygon instance named "PODKLAD"?
>
> Because this example from another post makes three new objects instead of 3x
> modifying the one existing object:
>
> #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
> }
The pigment IS overriden, but by an identical one. Try pigment{rgb<0, 
0.5, 1>} to see the difference.
>
> object {
>   ball scale <10, 10, 10>
> }
>
>

You can always redefine any object:
#declare Ball=sphere{0, 1 pigment{rgb<1,0,0>}}
#declare Ball=object{Ball scale 10 translate <5,12,1> pigment{bozo}}

The original Ball object no longer exist after been replaced by a 
scalled, translated and retextured version of itself.


Alain


Post a reply to this message

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