|
![](/i/fill.gif) |
In article <4400447f@news.povray.org>, war### [at] tag povray org says...
> Nekar Xenos <go_### [at] yahoo com> wrote:
> > I meant to replace my intitial suggestion with the second one. Is it not
> > possible to test intersection of a circle with an object? Please excuse me,
> > but I (obviosly)don't know how a raytracer is programmed. How is
> > intersection of a straight ray done? I was thinking of just replacing the
> > formula for the straight ray with the formula of a circle.
>
> How would a ray travelling in a circular path be any feasible way of
> emulating variable ior? I'm not even sure it's physically possible to
> have an object with an ior such that light travels in a circular path
> through it regardless of the direction.
>
Now... A Spline Path could work though, maybe? I mean your basically just
doing the same thing you do with any object, make a determination of
where it is likely to intersect. I am sure you could find some averaging
function to determine where the bounding box intersection is for a
"straight" line that would hit the same point. As well as something to
find the final "direction". If no other objects are intersected, you just
continue the ray from that final point on the surface of the object. If
intersection tests of a bounding box for something inside is detected,
then you calculate along the spline path, until you hit. When it leaves
the interior of the object you stop doing the extra calculations and
continue on a normal strait path.
Or something more or less like that. The only real question is, given an
object, can you determine an averaged IOR for the ray and a final
direction, allowing you to shortcut the calculations when no
intersections are possible. Of course, I don't know how media might be
effected by such a thing...
--
void main () {
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
![](/i/fill.gif) |