POV-Ray : Newsgroups : povray.newusers : Transparent object : Re: Transparent object Server Time
28 Jul 2024 14:31:29 EDT (-0400)
  Re: Transparent object  
From: Trevor G Quayle
Date: 23 Dec 2008 09:30:01
Message: <web.4950f4cef3ef2f50c67b294d0@news.povray.org>
"Delfo" <nomail@nomail> wrote:
> Hi everybody
> I would like to make a previously-declared object transparent. Since my idea is
> to have this object appearing both in transparent and solid version, I would
> like to know if there is a way to make it transparent without having to change
> ALL the colors in all sub-instances of said object.
> So far I've tried
>
> #declare MyObj=object {prev_declared_object
>                        hollow
>                        transmit 0.6}
>
> but the object appears as solid as if normally instanced...Is there a way to
> override the previous transparency with new settings, or shall I manually
> change all rgb declarations into rgbt?
> Thanks

Two ways you can do it:

1)  Declare the object, but don't apply the texture.  Apply the texture when it
is inserted.  With this method you need to declare two textures and it only
works if the object has a single texture applied to it.

2) Make a macro of the object with the specific colour to be changed as a
variable.  Anytime you insert it, you can just pass the colour you need.  This
is the most versatile method.

-tgq


Post a reply to this message

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