POV-Ray : Newsgroups : povray.newusers : using trace function Server Time
1 Nov 2024 05:20:31 EDT (-0400)
  using trace function (Message 1 to 2 of 2)  
From: shimon a10
Subject: using trace function
Date: 21 Mar 2006 17:05:00
Message: <web.442077e51868a27060cea7020@news.povray.org>
Hi, everybody.

1. I need help with the trace function.
2. When I trace rays from a point above the xz plane to the xz plane,I get
   that the normal at the intersection point (which is at the xz plane) is
   not zero at the x or z normal elements.
3. I'll be glad to get help.
4. Lots of thanks.

shimon


Post a reply to this message

From: Chris B
Subject: Re: using trace function
Date: 21 Mar 2006 18:12:41
Message: <44208869@news.povray.org>
"shimon_a10" <shi### [at] wallacoil> wrote in message 
news:web.442077e51868a27060cea7020@news.povray.org...
> Hi, everybody.
>
> 1. I need help with the trace function.
> 2. When I trace rays from a point above the xz plane to the xz plane,I get
>   that the normal at the intersection point (which is at the xz plane) is
>   not zero at the x or z normal elements.
> 3. I'll be glad to get help.
> 4. Lots of thanks.
>
> shimon
>


Hi Shimon,

It seems to work OK for me. Even to 12 decimal places it comes up with 0 for 
the x and z components of the normal vector.
I tried a few different starting points and different direction vectors, but 
it always gave me a normal vector pointing straight up.
The following example contains the code I used for the test.

camera {location <0,0,-1> look_at <0,0,0>}
light_source {<0,1,0> color rgb 1}

#local MyTarget = plane {y,0}
#local MyNormal = <0,0,0>;
#local MyPoint = trace ( MyTarget, <1,1,1>, <0,-1,-1>, MyNormal );
#debug concat("Normal: ",vstr(3,MyNormal,",",12,12),"\n")

text {ttf "crystal.ttf", vstr(3,MyNormal,",",3,3), 0.1,0
  scale 0.1
  pigment {color rgb <5,0,0>}
  translate <-0.3,0,0>
}

Regards,
Chris B.


Post a reply to this message

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