POV-Ray : Newsgroups : povray.general : Distorted sinusoidal fringe projection Server Time
24 Dec 2024 13:20:26 EST (-0500)
  Distorted sinusoidal fringe projection (Message 1 to 3 of 3)  
From: Louis-Severin
Subject: Distorted sinusoidal fringe projection
Date: 1 Sep 2006 03:00:00
Message: <web.44f7d9eb3a304ea3337e73ab0@news.povray.org>
Hello,

I try to simulate the projection, through distorting lenses, of a sinusoidal
grid. I found (thanks to Alain !) how to use photon option to project the
shadow of an object through a lens. But actually, my sinusoidal grid is
performed using a texture option. Accordingly, the projected shadow is the
one of the object and not the one of the texture. Is it any solution to
produce the shadow of a texture ? Hereunder my code to generate the
sinusoidal grid:

#declare H = 2;
#declare W = 2;
#declare nb_periods = 3;
#declare length_period = H / nb_periods;

intersection{
  // container
  box{
    <-H/2,-1,-W/2>
    <H/2,1,W/2>
    pigment {transmit 1}
  }

  // signal
  plane {
    y, 0 hollow
    texture {
      pigment {
        gradient x scale H/nb_periods
        sine_wave
        color_map {[0 rgb 1] [1 rgbf 1]}
      }
    }
  }
}

The resulting shadow is the one of the box and not the one of the signal. If
anyone could help me, i should be very grateful ! Thanks in advance...



Post a reply to this message

From: Tim Attwood
Subject: Re: Distorted sinusoidal fringe projection
Date: 2 Sep 2006 03:27:38
Message: <44f9326a$1@news.povray.org>
>... Is it any solution to
> produce the shadow of a texture ?

A hollow plane is still conceptually solid for CSG,
a intersection of a plane and a box results in a box...
By texturing the box with Clear on 5 sides you just
see into the hollow box, if the box happens to be
sitting with a clear bottom that is coincident to
some other object (like the default checkered
plane) then you see thru that as well. Since you
only really want the textured side, use clipped_by.

And since you are trying to "fake" shadows, you
probably don't want to see the texture itself.
I might be OK just to make your texture mimic
the shadow color, then place it near a flat surface,
or use the object pattern to place it as a partially
transparent layer on something.

#declare H = 2;
#declare W = 2;
#declare nb_periods = 3;
#declare length_period = H / nb_periods;
#declare SinePig = pigment {
   gradient x scale H/nb_periods
   sine_wave
   color_map {
      [0 color <0,0,0> transmit 0.2]
      [1 color <0,0,0> transmit 1]
   }
};
// as a "sticker"
plane { y, 0
   pigment { SinePig }
   clipped_by {
     box {
        <-H/2,-1,-W/2>,
        <H/2,1,W/2>
     }
  }
  translate <0,-0.999,0>
}

// as an object pattern
plane {y,-1
   texture {
      pigment{checker White Wheat}
   }
   texture {
      pigment {
         object {
            sphere {<0,-1,2>,1}
            pigment {Clear}
            pigment {SinePig}
         }
      }
   }
}


Post a reply to this message

From: Louis-Severin
Subject: Re: Distorted sinusoidal fringe projection
Date: 4 Sep 2006 11:25:00
Message: <web.44fc44c925098949337e73ab0@news.povray.org>
Hello,

Thank you really, the solution with the "sticker" works perfectly !

Best regards from Switzerland,





"Tim Attwood" <tim### [at] comcastnet> wrote:
> >... Is it any solution to
> > produce the shadow of a texture ?
>
> A hollow plane is still conceptually solid for CSG,
> a intersection of a plane and a box results in a box...
> By texturing the box with Clear on 5 sides you just
> see into the hollow box, if the box happens to be
> sitting with a clear bottom that is coincident to
> some other object (like the default checkered
> plane) then you see thru that as well. Since you
> only really want the textured side, use clipped_by.
>
> And since you are trying to "fake" shadows, you
> probably don't want to see the texture itself.
> I might be OK just to make your texture mimic
> the shadow color, then place it near a flat surface,
> or use the object pattern to place it as a partially
> transparent layer on something.
>
> #declare H = 2;
> #declare W = 2;
> #declare nb_periods = 3;
> #declare length_period = H / nb_periods;
> #declare SinePig = pigment {
>    gradient x scale H/nb_periods
>    sine_wave
>    color_map {
>       [0 color <0,0,0> transmit 0.2]
>       [1 color <0,0,0> transmit 1]
>    }
> };
> // as a "sticker"
> plane { y, 0
>    pigment { SinePig }
>    clipped_by {
>      box {
>         <-H/2,-1,-W/2>,
>         <H/2,1,W/2>
>      }
>   }
>   translate <0,-0.999,0>
> }
>
> // as an object pattern
> plane {y,-1
>    texture {
>       pigment{checker White Wheat}
>    }
>    texture {
>       pigment {
>          object {
>             sphere {<0,-1,2>,1}
>             pigment {Clear}
>             pigment {SinePig}
>          }
>       }
>    }
> }


Post a reply to this message

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