POV-Ray : Newsgroups : povray.unofficial.patches : 2 suggestions for Megapatch 0.5 : Re: 2 suggestions for Megapatch 0.5 Server Time
2 Sep 2024 10:16:02 EDT (-0400)
  Re: 2 suggestions for Megapatch 0.5  
From: Ron Parker
Date: 10 Feb 2000 21:07:47
Message: <slrn8a6s6k.rm.ron.parker@linux.parkerr.fwi.com>
On Thu, 10 Feb 2000 17:44:38 -0800, H.E. Day wrote:
>the normal and position if the ray collides with a declared object *and
>doesn't collide with any declared other objects*.
>I mean like this.
>
>trace2(object,testobject,start,vector,normal)
>
>Where "object" is the object you're shooting at, and "testobject" is the
>
>object you want to test.  This method would only test the "testobject"
>BEFORE the ray hits the "object".
>Can these be done???

#macro trace2(Object, TestObject, Start, Vector, Normal )
  #local TestNorm = <0,0,0>;
  #local ONorm = <0,0,0>;
  #local TestInt = trace(TestObject, Start, Vector, TestNorm);
  #local Int = trace(Object,Start,Vector,ONorm);
  #if (vlength(TestNorm)>.1 & vlength(ONorm)>.1)
    #if (vlength(TestInt-Start)>vlength(Int-Start))
      #declare Normal=ONorm;
      Int
    #else
      #declare Normal=<0,0,0>;
      <0,0,0>
    #end
  #else
    #declare Normal=ONorm;
    Int
  #end   
#end


Post a reply to this message

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