POV-Ray : Newsgroups : povray.newusers : Access to height field data : Re: Access to height field data Server Time
28 Jul 2024 20:25:00 EDT (-0400)
  Re: Access to height field data  
From: Kenneth
Date: 15 Oct 2008 00:40:00
Message: <web.48f57244cd5c214378dcad930@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> jan dvorak <jan### [at] centrumcz> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.