POV-Ray : Newsgroups : povray.general : selective transparency of objects : Re: selective transparency of objects Server Time
30 Jul 2024 22:18:43 EDT (-0400)
  Re: selective transparency of objects  
From: John VanSickle
Date: 30 Apr 2008 08:42:29
Message: <48186935@news.povray.org>
kike wrote:
> I'm nearly sure the answer to this question is a big NO but anyway:
> 
> Is it possible to have an object which is transparent for the whole scene but
> opaque for another single object. The idea is to reach the effect (in an
> animation) of objects dissappearing behind apparently non-existing objects.

The way I'd do it:

1: Render one version of the scene, with the object that you want to vanish.

2: Render another version, without the object.

3: Render a mask version, which contains the "blocking" object as solid 
full-ambient white, and everything else as black.

Ensure that the camera is positioned in the same way for all three renders.

4: Render a fourth scene:

#declare pigMask=pigment { image_map { png "mask.png" } }
#declare pigWith=pigment { image_map { png "with.png" } }
#declare pigWithout=pigment { image_map { png "without.png" } }

plane { -z,0
   pigment { pigment_pattern { pigMask }
     pigment_map {
       [0 pigWith]
       [1 pigWithout]
     }
     translate -.5
   }
   finish { ambient 1 diffuse 0 }
}

camera { orthographic
   right x
   up y
   direction z
   location -z
}

Hope this helps,
John


Post a reply to this message

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