POV-Ray : Newsgroups : povray.tools.general : Problem with trace() - how to test for ray directions other than towards or= : Re: Problem with trace() - how to test for ray directions other than towards or= Server Time
6 Oct 2024 03:33:29 EDT (-0400)
  Re: Problem with trace() - how to test for ray directions other than towards or=  
From: Jaime Vives Piqueres
Date: 19 May 2007 05:39:41
Message: <464ec5dd$1@news.povray.org>
Yadgar wrote:
>     #declare xpos=rand(r1)*20-10;
>     #declare zpos=rand(r2)*20-10;
>     #declare Terrain_Temporary=
>     object { Terrain translate <-xpos, 0, -zpos> }
>     #declare trvect=<0, 20, 0>;
>     #declare rad=0.01+rand(r3)/100*9;
>     #declare pos=trace(Terrain_Temporary, trvect, -trvect)+<0, rad, 0>;


  Looking at this code, I can't see how you would get any other result: you 
are tracing always from <0,20,0> to <0,-20,0>, so obviously the x and z 
coordinates of the intersection must be always 0. Or perhaps I didn't have 
enough coffee this morning? :)

I think moving around the terrain is a strange idea: you will be better 
moving around trvect.

Regards,

--
Jaime


Post a reply to this message

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