|
|
On Tue, 18 May 1999 00:02:23 +0200, Rune S. Johansen wrote:
>Well, I just thought might be possible to combine the calculation of the
>intersection of any object with the intersection of a sphere. I would think
>a sphere intersection is made if the ray comes nearer than [radius] units
>from the center. The same way a spherized object intersection should be made
>if the ray comes nearer than [float] units from any point in the object. But
>since I am not a programmer, I don't know if that actually make sense or
>not.
The problem is that while it's usually a simple test to know if a ray hit an
arbitrary object, knowing whether it came within 'x' units of an object is
a whole different can of worms. (And, in fact, if you could know that you
would have the answer immediately.) For some objects, like spheres, it's an
easy test. For other objects, like boxes and cylinders, it's not at all easy.
In fact, it's easier to just do boxes and cylinders as macros. For height
fields and meshes, it's truly ugly no matter how you do it. CSG intersection
would probably be ugly, too. The common thread here is that things with sharp
edges are likely to be hard to deal with. Most nontrivial objects have sharp
edges.
I did read a paper once, describing a very realistic method of simulating
dirt on an object, that makes me wish this operation were less ugly. They
had some interesting ideas on the subject, but the implementation wasn't what
one could call easy.
Post a reply to this message
|
|