POV-Ray : Newsgroups : povray.beta-test : Bug in trace function, normal flipped for text and prism objects? : Re: Bug in trace function, normal flipped for text and prism objects? Server Time
8 May 2024 15:04:22 EDT (-0400)
  Re: Bug in trace function, normal flipped for text and prism objects?  
From: clipka
Date: 8 Feb 2013 19:24:44
Message: <5115974c$1@news.povray.org>
Am 08.02.2013 22:07, schrieb Wouter:
> Using version: 3.7.0.RC6.msvc10.win64
>
> Hi there,
>
> I noticed some problems with the trace function:
>
> - when using it on a text object: when you hit the side of a letter, the normal
> that is returned is flipped (the exact opposite of what it should be). When you
> hit the front of a letter the normal is correct.
>
> - when using it on a prism object: varied results, at least partly depending on
> the order of the points. Sometimes the sides of the prism return the correct
> normal, sometimes flipped. Top and bottom are also unpredictable.

I can confirm this behaviour. However, a quick check shows that this is 
nothing new: 3.6.2 gives the same results.

As a workaround, you can use the following code:

     #local Origin = <-100,0,0>;
     #local Dir = <1,0,0>;
     #local Norm = <0,0,0>;
     #declare Inter = trace(Obj,Origin,Dir,Norm);
     #if (vdot(Dir,Norm) > 0)
       #local Norm = -Norm;
     #end


Post a reply to this message

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