POV-Ray : Newsgroups : povray.newusers : newbie filter issue Server Time
1 Nov 2024 16:22:33 EDT (-0400)
  newbie filter issue (Message 1 to 4 of 4)  
From: movie geek
Subject: newbie filter issue
Date: 16 Nov 2007 07:15:00
Message: <web.473d885ce9fea729cc55aa9c0@news.povray.org>
I was trying out some of the demos/tutorials, and ran into a problem with the
"filter" command. The problem being that "filter" does not seem to work. This
is in the "csgdemo.pov" tutorial. I followed the code more or less as it
appears in the help guide, but I'm not getting any transparency as the tutorial
says I should. Here's the code as I've written it (slightly different from the
tutorial):

// BEGIN HERE
#include "colors.inc"
camera {
 location <0, 1, -10>
 look_at 0
 angle 36
}

light_source { <500, 500, -1000> White }
plane { y, -1.5
 pigment { checker Green White }
 rotate y*25
}

#declare Lens_With_Hole =
difference {
 intersection {
  sphere { <0, 0, 0>, 1
   // pigment { Blue }
   translate -0.5*x
  }
  sphere { <0, 0, 0>, 1
   // pigment { Red }
   translate 0.5*x
  }
  pigment { Red }
  // scale <1, .25, 1>
  // rotate <30, 0, 45>
  rotate y*90
 }

 cylinder { <0, 0, -1> <0, 0, 0>, .35
  pigment { Blue }
 }
 // rotate y*-30
}

merge {
 object { Lens_With_Hole translate <-.65, .65, 0> }
 object { Lens_With_Hole translate <.65, .65, 0> }
 object { Lens_With_Hole translate <-.65, -.65, 0> }
 object { Lens_With_Hole translate <.65, -.65, 0> }
 pigment { Red filter .5 } // um, filter does not seem to be working
}

// END HERE


Any ideas? Is the tutorial wrong, or did I miss something? Any help would be
appreciated.


Post a reply to this message

From: Bill Pragnell
Subject: Re: newbie filter issue
Date: 16 Nov 2007 07:35:01
Message: <web.473d8dbea6c62f67731f01d10@news.povray.org>
Your Lens_With_Hole def still has pigments in it. These are overriding the final
pigment (the one with the filter). Comment or remove them and it should work
fine.

Bill


Post a reply to this message

From: Trevor G Quayle
Subject: Re: newbie filter issue
Date: 16 Nov 2007 07:35:01
Message: <web.473d8e0da6c62f672ae8612c0@news.povray.org>
"movie_geek" <nomail@nomail> wrote:
> I was trying out some of the demos/tutorials, and ran into a problem with the
> "filter" command. The problem being that "filter" does not seem to work. This
> is in the "csgdemo.pov" tutorial. I followed the code more or less as it
> appears in the help guide, but I'm not getting any transparency as the tutorial
> says I should. Here's the code as I've written it (slightly different from the
> tutorial):
>
> // BEGIN HERE
> #include "colors.inc"
> camera {
>  location <0, 1, -10>
>  look_at 0
>  angle 36
> }
>
> light_source { <500, 500, -1000> White }
> plane { y, -1.5
>  pigment { checker Green White }
>  rotate y*25
> }
>
> #declare Lens_With_Hole =
> difference {
>  intersection {
>   sphere { <0, 0, 0>, 1
>    // pigment { Blue }
>    translate -0.5*x
>   }
>   sphere { <0, 0, 0>, 1
>    // pigment { Red }
>    translate 0.5*x
>   }
>   pigment { Red }
>   // scale <1, .25, 1>
>   // rotate <30, 0, 45>
>   rotate y*90
>  }
>
>  cylinder { <0, 0, -1> <0, 0, 0>, .35
>   pigment { Blue }
>  }
>  // rotate y*-30
> }
>
> merge {
>  object { Lens_With_Hole translate <-.65, .65, 0> }
>  object { Lens_With_Hole translate <.65, .65, 0> }
>  object { Lens_With_Hole translate <-.65, -.65, 0> }
>  object { Lens_With_Hole translate <.65, -.65, 0> }
>  pigment { Red filter .5 } // um, filter does not seem to be working
> }
>
> // END HERE
>
>
> Any ideas? Is the tutorial wrong, or did I miss something? Any help would be
> appreciated.

Remove the previous "pigment {Red}" from the object declaration.  You have
already given the spheres a solid red pigment, the second pigment in the merge
only gets applied to objects that don't have previously declared pigments.  It
doesn't override previous ones.  (the same is true for finish, normal, texture,
material, etc.)

-tgq


Post a reply to this message

From: movie geek
Subject: Re: newbie filter issue
Date: 17 Nov 2007 04:00:01
Message: <web.473eac87a6c62f67cc55aa9c0@news.povray.org>
Excellent! Worked perfectly! Thanks for your help. I knew it was something
simple like this.


Post a reply to this message

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