POV-Ray : Newsgroups : povray.newusers : Casting sinusoidal shadow on an object ? Server Time
2 Nov 2024 15:23:28 EDT (-0400)
  Casting sinusoidal shadow on an object ? (Message 1 to 5 of 5)  
From: Omega
Subject: Casting sinusoidal shadow on an object ?
Date: 12 Nov 2003 15:40:01
Message: <web.3fb29a7b2d6843d5d947fdc0@news.povray.org>
I'd like to create a sinusoidal shadow on an object.

Does anyone have an idea on how to do that?

Here what I've tried: I created several boxes objects between the source
light and the object to be shadowed. I then set the light to be a an
area_light type. But...it creates a triangular shadow (when doing a line
profile in X).

Something I would have liked to try, is defocusing the shadow produced by my
boxes objects using some kind of lens...but I don't know how to do that.

Any help?

Regards,
O.

Source Code:
////////////////////////////////////////////////////////////////
/// Synthesize a BGA 19x19 image


global_settings { assumed_gamma 2.2 }

#include "colors.inc"
#include "textures.inc"
#include "stones.inc"


camera {
  orthographic
  location <0, 0, -500>
  right <640, 0, 0>
  up <0, 480, 0>
  look_at <0, 0, 0>
}


background { color MidnightBlue }

plane { z, 0
   pigment {
      colour Gray40
   }
   finish {
      ambient 0.2
      diffuse 0.8
   }
}


#declare Unit_To_Mm = 1;    // 1 unit is X mm

#declare Ronchi_Line_Width = 5;
#declare Ronchi_WidthX = 1200;
#declare Ronchi_HeightY = 1200;

#declare Fringe = box {
    <0, Ronchi_HeightY,  0>,  // Near lower left corner
    <Ronchi_Line_Width, -Ronchi_HeightY, 0>   // Far upper right corner
    pigment { color Black }
  }


#declare Ronchi = union {
 object { Fringe translate <0,0,0> }
 //object { Fringe translate <2*Ronchi_Line_Width,0,0> }

 #declare F = 2*Ronchi_Line_Width;
 #while (F < Ronchi_WidthX/2)
  object { Fringe translate x*F }
  object { Fringe translate -x*F }
  #declare F = F + 2*Ronchi_Line_Width;
 #end
}


object { Ronchi translate <0, 0, -1900> }

light_source { <0, 0, -2000> colour Gray70
    area_light <5, 0, 0>, <0, 1, 0>, 10, 1
    adaptive 1
    jitter
}


Post a reply to this message

From: Christopher James Huff
Subject: Re: Casting sinusoidal shadow on an object ?
Date: 12 Nov 2003 18:38:43
Message: <cjameshuff-3748BE.18355612112003@netplex.aussie.org>
In article <web.3fb29a7b2d6843d5d947fdc0@news.povray.org>,
 "Omega" <nomail@nomail> wrote:

> I'd like to create a sinusoidal shadow on an object.
> 
> Does anyone have an idea on how to do that?

Put a sinusoidal object between it and the light?


> Here what I've tried: I created several boxes objects between the source
> light and the object to be shadowed. I then set the light to be a an
> area_light type. But...it creates a triangular shadow (when doing a line
> profile in X).

I'm having trouble understanding what kind of shadow you are trying to 
achieve. You want something sinusoidal in intensity rather than shape? 
You use the term "Ronchi" several times...you're trying to simulate a 
Ronchi grating?

Try a plane with a partially transparent texture instead:
plane {-z, 1900 hollow
    texture {
        pigment {gradient x scale Ronchi_Line_Width
            sine_wave
            color_map {[0 rgb 1] [1 rgbf 1]}
        }
    }
}


> Something I would have liked to try, is defocusing the shadow produced by my
> boxes objects using some kind of lens...but I don't know how to do that.

Well, fuzzy shadows can be had with an area light, but you already know 
that...if you're looking for a true diffraction effect, POV is incapable 
of simulating it.


> ////////////////////////////////////////////////////////////////
> /// Synthesize a BGA 19x19 image

BGA 19x19?

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Omega
Subject: Re: Casting sinusoidal shadow on an object ?
Date: 13 Nov 2003 10:20:01
Message: <web.3fb3a0b3a347d771ccd526b40@news.povray.org>
Christopher James Huff wrote:
>In article <web.3fb29a7b2d6843d5d947fdc0[at]news.povray.org>,
> "Omega" <nomail[at]nomail> wrote:
>
>> I'd like to create a sinusoidal shadow on an object.
>>
>> Does anyone have an idea on how to do that?
>
>Put a sinusoidal object between it and the light?

Yeah.. couldn't figure out how.. ;)

>> Here what I've tried: I created several boxes objects between the source
>> light and the object to be shadowed. I then set the light to be a an
>> area_light type. But...it creates a triangular shadow (when doing a line
>> profile in X).
>
>I'm having trouble understanding what kind of shadow you are trying to
>achieve. You want something sinusoidal in intensity rather than shape?
>You use the term "Ronchi" several times...you're trying to simulate a
>Ronchi grating?

Yes, I want a sinusoidal signal in intensity.. actually simulating a
defocused Ronchi grating

>Try a plane with a partially transparent texture instead:
>plane {-z, 1900 hollow
>    texture {
>        pigment {gradient x scale Ronchi_Line_Width
>            sine_wave
>            color_map {[0 rgb 1] [1 rgbf 1]}
>        }
>    }
>}

Oh great, that's what I was looking for!

Nice, it seems to work the way I want.. but is there a way to get rid of the
discontinuity occuring at x=0? (the sine phase starts at phi=0 and
increments in both direction, thus creating positive values over an entire
period of the sine)

>> Something I would have liked to try, is defocusing the shadow produced by my
>> boxes objects using some kind of lens...but I don't know how to do that.
>
>Well, fuzzy shadows can be had with an area light, but you already know
>that...if you're looking for a true diffraction effect, POV is incapable
>of simulating it.

Okay.. no problem, the hollow plane will do the trick

Thanks again,
O.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Casting sinusoidal shadow on an object ?
Date: 13 Nov 2003 10:46:01
Message: <cjameshuff-C652EB.10430113112003@netplex.aussie.org>
In article <web.3fb3a0b3a347d771ccd526b40@news.povray.org>,
 "Omega" <nomail@nomail> wrote:

> Nice, it seems to work the way I want.. but is there a way to get rid of the
> discontinuity occuring at x=0? (the sine phase starts at phi=0 and
> increments in both direction, thus creating positive values over an entire
> period of the sine)

Forgot about that...the simplest solution would be to replace "gradient 
x" with "function {sin(x)/2 + 0.5}", or you could use cos() if you want 
a symmetrical pattern. Oh, and remove the sine_wave keyword, since it is 
now in the pattern itself. Or you could just translate the pattern far 
enough that the mirroring point is out of your way.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Omega
Subject: Re: Casting sinusoidal shadow on an object ?
Date: 13 Nov 2003 12:10:01
Message: <web.3fb3bab0a347d771ccd526b40@news.povray.org>
Christopher James Huff wrote:
>Forgot about that...the simplest solution would be to replace "gradient
>x" with "function {sin(x)/2 + 0.5}", or you could use cos() if you want
>a symmetrical pattern. Oh, and remove the sine_wave keyword, since it is
>now in the pattern itself. Or you could just translate the pattern far
>enough that the mirroring point is out of your way.

Ok, replacing the gradient x with a function is a far better solution than
what I did.. which was to add the keyword "phase 0.25" so the sin would be
in sync ;)

Thanks for the tip,
O.


Post a reply to this message

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