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
5 Sep 2024 01:46:09 EDT (-0400)
  Re: Can you use the trace command on a heightfield?  
From: Dre
Date: 8 Apr 2010 18:40:49
Message: <4bbe5b71$1@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:4bbd832a$1@news.povray.org...
>
> "Dre" <and### [at] gmailcom> schreef in bericht 
> news:4bbd517d$1@news.povray.org...
>> "Dre" <and### [at] gmailcom> wrote in message 
>> news:4bbd2f59$1@news.povray.org...
>>> Hi, as the title states, can you use the trace command on a heightfield?
>>>
>>> I've been trying and trying and I cant get it to work.  I've 
>>> successfully used the trace() command on isosurfaces and simple boxes, 
>>> spheres but I cant for the life of me get this to work.
>>>
>>> Just wondering if this actually does work or I'm barking up the wrong 
>>> tree!
>>>
>>> Cheers Dre
>>>
>> Nevermind, I worked it out, that trace command has some weirdness about 
>> it.
>>
>> This doesn't work:
>>
>> #declare norm = <0, 0, 0>;
>> trace(object, <xPos, 10, zPos>, <xPos, -10, zPos>, norm>)
>>
>> Yet this does:
>>
>> #declare norm = <0, 0, 0>;
>> #declare startPoint =<xPos, 10, zPos>;
>> #declare endPoint = <xPos, -10, zPos>;
>> trace(object, startPoint, endPoint, norm)
>>
>> Unless I'm doing something wrong, that seems broken to me...
>>
>
>
> No, trace() is not broken. The following always works for me, with 
> whatever object as target:
>    #declare Norm =  <0, 0, 0>;
>    #declare Start = <my.x, 10, my.z>;
>    #declare Pos = trace (Obj, Start, -y, Norm);
>
> Start must be above the object, so adapt the y value; -y indicates the 
> direction of tracing.
>
> Thomas
>

Yes that format works for me too, now try your example without the 
variables, put the actual vectors in your Pos declaration and see if you get 
the same results.  I dont.

Cheers Dre


Post a reply to this message

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