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:18:23 EDT (-0400)
  Re: Can you use the trace command on a heightfield?  
From: Alain
Date: 12 Apr 2010 09:13:40
Message: <4bc31c84$1@news.povray.org>

> "Warp"<war### [at] tagpovrayorg>  wrote in message
> news:4bbebfde@news.povray.org...
>> Dre<and### [at] gmailcom>  wrote:
>>> No it parses correctly, however none of the intersections are correct,
>>> they
>>> are all either at<0, 0, 0>  or some weird location.
>>
>>   Because you are not shooting the rays towards<0, -1, 0>.
>>
>> --
>>                                                           - Warp
>
> I believe I am shooting them in that direction, they are starting at<x, 10,
> z>  and finishing at<x, -10, y>, thats towards<0, -1, 0>  in my mind or am I
> wrong here?
>
> Cheers Dre
>
>

You are wrong :(

If you start at <x,10,z> and have a direction of <x,-10,z>, then, you 
shoot toward <x*2,0, z*2>.
Remember, the first value is the starting location.

The second value is a *direction* vector, it is ADDED to the start 
location. If you use a /location/ your tracing rays will fan out.

The result is that most rays, about 75% if the hight_field is around the 
X-Z plane, will totaly miss the hight_field. Any ray that don't hit the 
target will return a location of <0,0,0> and a normal of <0,0,0>.
If the hight_field is a around -10*y, then only 1/16 trace will hit it, 
at the wrong locations.



Alain


Post a reply to this message

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