|
![](/i/fill.gif) |
Kenneth nous illumina en ce 2008-10-15 00:35 -->
> 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
>
>
>
>
>
>
> I prefer to simply use:
#if(vlength(Norm))
...
#end
Any non-zero value evaluate as true.
No need for the empty #else.
--
Alain
-------------------------------------------------
To the world you may be one person, but to one person you may be the world.
Post a reply to this message
|
![](/i/fill.gif) |