POV-Ray : Newsgroups : povray.general : Can't make object shadowless : Re: Can't make object shadowless Server Time
2 Nov 2024 11:22:53 EDT (-0400)
  Re: Can't make object shadowless  
From: Mike Williams
Date: 20 Mar 2004 06:36:22
Message: <AcyILBAVsCXAFwid@econym.demon.co.uk>
Wasn't it dt7### [at] bellsouthnet who wrote:
>The following code produces a sphere with a hole going through the
>middle, and the sphere is semi-transparent so the hole can be seen.
>
>The problem I am having is I can't stop the shadow from occurring on
>the sphere from the cylinder object.
>
>I know I can make the lightsource shadowless, but then I don't get the
>shadow from the sphere on the plane.
>
>The no_shadow keyword does not work for an object when it is inside a
>difference command.
>
>Help is appreciated.

Here's one possibility

Step 1: apply no_shadow to the whole difference

difference { 
    sphere {<0, 0, 0>, 
        1
        pigment {color Green filter .35}
       }

    cylinder {<0, -1, 0>,
              <0, 1, 0>,
        .2
        pigment {color Green}
       }
       no_shadow
}


Step 2: add a no_image sphere in the same place to cast a shadow that
looks just like what the sphere would have cast. 

sphere {<0,0,0> 1
 pigment {color Green filter .35}
 no_image
 }


Optional Final tweak: Cut a hole in the invisible sphere. This changes
the amount of light that hits the inside of the hole.

sphere {<0,0,0> 1
 clipped_by {cylinder {<0,-2,0><0,1,0>,.2 inverse}}
 pigment {color Green filter .35}
 no_image
 }


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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