POV-Ray : Newsgroups : povray.general : How to make object be transparent with alpha channel in the final image? : Re: How to make object be transparent with alpha channel in the final image? Server Time
31 Jul 2024 12:25:57 EDT (-0400)
  Re: How to make object be transparent with alpha channel in the final image?  
From: Shay
Date: 11 Sep 2007 10:12:02
Message: <46e6a232$1@news.povray.org>
Hor wrote:
> Hello,
> 

The only perfect solution would be to build the exact geometry you want, 
but this is the easiest imperfect solution. There are some cludges 
(image_map used in an image_pattern renders dark for some reason), but 
I'm on my way out, so this is as good as it's going to get. Save the 
following as clear_intersections.pov and run with the command line 
options specified in the comment lines.

  -Shay

// 2D overlaps are transparent
// render +kfi1 +kff3 +ua

global_settings{
     assumed_gamma 1
}

#local MySceneGeometry = union {
     torus{.5, .03
         translate <0,0,.25>
         rotate <0,0,0>
     }
     torus{.5, .03
         translate <0,.1,.25>
         rotate <0,72,0>
     }
     torus{.5, .03
         translate <0,.2,.25>
         rotate <0,144,0>
     }
     torus{.5, .03
         translate <0,.3,.25>
         rotate <0,216,0>
     }
     torus{.5, .03
         translate <0,.4,.25>
         rotate <0,288,0>
     }
     rotate <90,0,0>
}

// frame 1 is the normal scene
#if (frame_number=1)
     camera{
         location <0,0,-2>
         look_at <0,0,0>
     }
     light_source{
         <25,25,-25>
         color rgb 1
     }
     object{MySceneGeometry
         pigment{rgb <1,0,0>}
     }
#end

// frame two puts light spots at the
// 2D overlaps
#if (frame_number=2)
     plane{-z, -10
         pigment{rgb 0}
     }
     camera{
         location <0,0,-2>
         look_at <0,0,0>
     }
     object{MySceneGeometry
         pigment{rgbt <1,1,1,.5>}
         finish{ambient 1}
     }
#end

// frame three cuts out the overlaps
#if (frame_number=3)
     #local PicturePig = pigment{
         image_map{
             png "clear_intersections1.png"
         }
     }
     camera{orthographic
         location <.5,.5,-1>
         look_at <.5,.5,0>
         up 1*y
         right 1*x
     }
     box{<0,0,0>, <1,1,1>
         pigment{
             image_pattern{
                 png "clear_intersections2.png"
             }
             pigment_map{
                 [.87 PicturePig]
                 [.93 PicturePig transmit 1]
              }
          }
         finish{ambient 1.5}
     }
#end


Post a reply to this message

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