POV-Ray : Newsgroups : povray.programming : Refraction Server Time
21 Dec 2024 20:33:24 EST (-0500)
  Refraction (Message 1 to 3 of 3)  
From: mc
Subject: Refraction
Date: 5 Dec 2007 19:59:20
Message: <47574968$1@news.povray.org>
Hi,

I'm not sure I understand how it's treated so please enlighten me.  Looking 
at the code, it seems to me that there's a "problem" in the determination of 
refracted rays.

Say you have a glass filled with water as per lousy diagram below
      +-------+      air
      |      |+----------------+
      |      ||                |
air  | glass ||    water      |
      |      ||                |
      |      |+----------------+
      |      +------------------
      |
      +--------------------------

Say a ray is shot from the right side.
a) ray starts in the air and hits the side of the glass. Ray_Enter() will 
add "glass" to the list of traversed media. A refracted "air/glass" ray is 
spawned
b) the refracted ray from (a) will hit the "other" of the glass, in other 
words it exits the glass. Glass is removed from the "stack" by Ray_Exit(). 
A new refracted ray is spawned.

Where I'm not sure I got it straight is that it looks like the refracted ray 
in b) is going to be "glass/air" instead of "glass/water" as we don't know 
yet that water will be hit.

Comments are most welcome.

Best regards,

MC


Post a reply to this message

From: ingo
Subject: Re: Refraction
Date: 8 Dec 2007 14:11:58
Message: <Xns9A00CD7B34084seed7@news.povray.org>
in news:47574968$1@news.povray.org mc wrote:

> Where I'm not sure I got it straight is that it looks like the
> refracted ray in b) is going to be "glass/air" instead of
> "glass/water" as we don't know yet that water will be hit.
> 
> 

From a modelling point of view, to get a better visual result, modell 
the water so it slightly overlaps the glass, no air gap between the 
two.

A solution in the POV-Ray source was once posted by Ron Parker in 
comp.graphics.rendering.raytracing. Couldn't find is posting with a 
quick search...

ingo


Post a reply to this message

From: mc
Subject: Re: Refraction
Date: 10 Dec 2007 17:11:50
Message: <475db9a6$1@news.povray.org>
Thank you.

"ingo" <ing### [at] tagpovrayorg> wrote in message 
news:Xns9A00CD7B34084seed7@news.povray.org...
> in news:47574968$1@news.povray.org mc wrote:
>
>> Where I'm not sure I got it straight is that it looks like the
>> refracted ray in b) is going to be "glass/air" instead of
>> "glass/water" as we don't know yet that water will be hit.
>>
>>
>
> From a modelling point of view, to get a better visual result, modell
> the water so it slightly overlaps the glass, no air gap between the
> two.
>
> A solution in the POV-Ray source was once posted by Ron Parker in
> comp.graphics.rendering.raytracing. Couldn't find is posting with a
> quick search...
>
> ingo


Post a reply to this message

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