POV-Ray : Newsgroups : povray.advanced-users : Can't figure out a formula! : Re: Can't figure out a formula! Server Time
30 Jul 2024 14:25:24 EDT (-0400)
  Re: Can't figure out a formula!  
From: Ron Parker
Date: 19 May 1999 15:44:51
Message: <374306a3.0@news.povray.org>
On Wed, 19 May 1999 16:38:53 GMT, Jeff Lee wrote:
>I'm trying to write a macro that takes three points, and creates a plane
>which is rotated and translated to intersect all three points.  Now, I
>think I've figured out how to get the normal of the triangle described
>by the points, but I'm not sure exactly how to turn that into an angle.

You don't need an angle.  You don't need to rotate or translate.
A plane is defined by its normal and offset, so just find those:

This is untested, but if it's wrong it's probably just by a sign 
somewhere.

#macro MakePlane(a,b,c) 
  #local n=vnormalize(vcross((b)-(a),(c)-(a)));
  #local o=vdot((a),n);
  plane {n,o}
#end


Post a reply to this message

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