POV-Ray : Newsgroups : povray.general : Can't make object shadowless Server Time
16 Nov 2024 05:19:53 EST (-0500)
  Can't make object shadowless (Message 1 to 3 of 3)  
From: dt731
Subject: Can't make object shadowless
Date: 19 Mar 2004 18:36:18
Message: <hgum505v3ifs97661oof92mhtitp1qfd5g@4ax.com>
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.
DeLeon

*** CODE BELOW ***

# include "colors.inc"

#declare CamLoc = < 0,2,-2.5>;

camera {
	location CamLoc
	look_at < 0, 0, 0>
}

light_source {CamLoc color White*1.2}
light_source {<50, 50,75> color White*1.7}

plane { <0, 1, 0>, -1
    pigment {
      checker color Red * 0.5, color Blue * 0.5
    }
  }

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

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


Post a reply to this message

From: Warp
Subject: Re: Can't make object shadowless
Date: 20 Mar 2004 05:14:49
Message: <405c1999@news.povray.org>
dt7### [at] bellsouthnet wrote:
> difference { 
>     sphere {<0, 0, 0>, 
>         1
>         pigment {color Green filter .35}
>        }

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

  One solution which comes to mind is to clip the sphere with the
cylinder (with clipped_by) and then adding an shadowless open cylinder
in the same place. Something like this:

union
{ sphere
  { 0, 1
    clipped_by { cylinder { -y, y, .2 inverse } }
    pigment { rgb y filter .35 }
  }
  cylinder
  { -y, y, .2 open no_shadow
    pigment { rgb y }
  }
}

  (The problem is that the borders of the cylinder will not match with
the surface of the sphere so you'll have to shorten the cylinder so that
they match.)

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Mike Williams
Subject: Re: Can't make object shadowless
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.