POV-Ray : Newsgroups : povray.general : Can you use the trace command on a heightfield? : Re: Can you use the trace command on a heightfield? Server Time
30 Jul 2024 06:26:01 EDT (-0400)
  Re: Can you use the trace command on a heightfield?  
From: Kenneth
Date: 9 Apr 2010 13:40:00
Message: <web.4bbf648570f2d07d65f302820@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Dre <and### [at] gmailcom> wrote:
> > Yet this does:
>
> > #declare norm = <0, 0, 0>;
> > #declare startPoint =<xPos, 10, zPos>;
> > #declare endPoint = <xPos, -10, zPos>;
> > trace(object, startPoint, endPoint, norm)
>
>   I don't think it does (well, not in the way you want). The third parameter
> of trace() specifies a direction, not an endpoint.
>
>   Probably you want the third parameter to be <0, -1, 0> because that's
> the direction you are shooting the rays towards.
>

Warp's correct. (Also, I would assume that <0,-10,0> has the same directional
effect as <0,-1,0> )

There's a big difference between <xpos,-10,zPos> and <0,-10,0> as a *direction*
vector. Let's say xPos=7 and zPos=5.  That produces a *direction* of
<7,-10,5>--which certainly isn't straight down. The trace rays are probably not
even hitting the HF (and your placed object(s) are ending up at a <0,0,0>
location by default, unless you're using Norm to 'stop' that in some way, which
I assume you are.)

As has been mentioned:
* The trace ray 'start' location needs to be somewhere *above* the
HF...obviously  ;-)  Personally, I would use <xPos,1000,zPos> to be safe.
* the 'start' vector is an actual location point; the trace ray direction is a
*directional* vector, NOT the location of a point, and shouldn't normally
change--at least when tracing a HF.

Ken


Post a reply to this message

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