|
![](/i/fill.gif) |
>>>> You already do it for AllIsect(). There's no additional work necessary.
>>>
>>> In Java, calling AllIsect() causes all intersections to be computed. In
>>> Haskell, calling the isect function does /not/ necessarily cause all
>>> intersections to be computed. Only the ones you actually "look at".
>>> That's the point I'm making.
>>
>> As Clipka pointed out, you need to calculate all intersections anyway to
>> find the nearest one.
>
> And as I pointed out, this is not the case for many objects. E.g., a
> sphere has two points of intersection. These are the solutions to a
> quadratic equation. And we all know that the way to solve that is
>
> x = -b +/- Sqrt(b^2 - 4ac) / 2a
>
> To find the "nearest" intersection, you merely pick the "-" rather than
> the "+". Done.
Assuming your sphere is to the "right" of your ray starting point.
>>
>> I was just pulling your leg. You can call your variables Fred, Pebbles
>> and Bambam if you want to. Just don't go about making readability
>> claims, if you do, though. :)
>
> Is it wrong that I actually know who those people are? o_O
>
No. It's not like the Flintstones is an obscure reference.
--
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/* flabreque */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/* @ */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/* gmail.com */}camera{orthographic location<6,1.25,-6>look_at a }
Post a reply to this message
|
![](/i/fill.gif) |