|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> jan dvorak <jan### [at] centrum cz> wrote:
> > What if the trace misses the object?
>
> The returned normal vector will be zero.
>
> --
> - Warp
.......and your traced-on object will be placed at <0,0,0> by default. Without
some kind of 'escape' mechanism, you might end up with *lots* of objects there.
The standard way to keep that from happening is to do this before actually
making or calling an object:
#if(vlength(norm) != 0) // that's "not equal to zero"
object{my_object translate <...the traced location...>}
#else
// DON'T make an object
#end
If the trace 'ray' goes off your height_field (or whatever), norm will be
<0,0,0> -- and vlength of that will be zero. Very handy!
KW
Post a reply to this message
|
![](/i/fill.gif) |