POV-Ray : Newsgroups : povray.binaries.images : Added trace() to Clutter macro : Re: Added trace() to Clutter macro Server Time
18 Aug 2024 08:22:28 EDT (-0400)
  Re: Added trace() to Clutter macro  
From: Ron Parker
Date: 7 Jul 2001 21:13:16
Message: <slrn9kfcr5.aqc.ron.parker@fwi.com>
On Sat, 7 Jul 2001 14:29:53 +0200, JRG wrote:
>If you want to know the y coordinate of a point (i.e. its height):
>
>#local _alt=vdot(y,trace( land, temp_pos+10000*y,-y));  // check the
>altitude
>
>or, even easier:
>
>#local _alt=(trace( land, temp_pos+10000*y,-y)).y;  // check the altitude
>
>(I didn't check if the last notation works, but it should).
>
>Where land is the landscape object,
>temp_pos is the coordinate (of XZ plane) you want to check (you are supposed
>to not use landscapes higher than 10000 units...).
>
>For normal calculation things are slightly more complicate (even if it's
>just another line of trig formulae).

You shouldn't need another line of trig.  You should be able to do:

#local _norm = <0,0,0>;
#local _alt=trace(land, temp_pos+10000*y,-y,_norm).y;

and find the normal at the intersection in the _norm vector (or <0,0,0> if 
no intersection was found.)

-- 
#local R=<7084844682857967,0787982,826975826580>;#macro L(P)concat(#while(P)chr(
mod(P,100)),#local P=P/100;#end"")#end background{rgb 1}text{ttf L(R.x)L(R.y)0,0
translate<-.8,0,-1>}text{ttf L(R.x)L(R.z)0,0translate<-1.6,-.75,-1>}sphere{z/9e3
4/26/2001finish{reflection 1}}//ron.parker@povray.org My opinions, nobody else's


Post a reply to this message

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