POV-Ray : Newsgroups : povray.advanced-users : Can't figure out a formula! : Re: Can't figure out a formula! Server Time
2 Nov 2024 15:24:02 EDT (-0400)
  Re: Can't figure out a formula!  
From: Jeff Lee
Date: 19 May 1999 16:48:03
Message: <37431573.0@news.povray.org>
par### [at] fwicom (Ron Parker) wrote:
>
> You don't need an angle.  You don't need to rotate or translate.

Unfortunately, I neglected to mention that I need to align a texture to
the plane (I omitted that from the code snippet for clarity), so I still
do need the information.  I think I figured out what I did wrong,
though; it looks like this makes it work:

#macro safeatan(a,b) #if (a|b) degrees(atan2(a,b)) #else 0.0 #end #end

#macro MakePlane( a, b, c )
  #local n  = vnormalize( vcross( b-a, c-a ));
  #local v1 = -(90-(safeatan(n.y,sqrt(n.z*n.z+n.x*n.x))));
  #local v2 = (safeatan(n.x,n.z))-180;
  #local d  = <v1,v2,0>;
  plane { y, 0 texture { whatever } rotate d translate c }
#end



-- 
Jeff Lee         shi### [at] gatenet         http://www.gate.net/~shipbrk/


Post a reply to this message

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