POV-Ray : Newsgroups : povray.general : Q: plane equation : Re: Q: plane equation Server Time
12 Aug 2024 23:17:34 EDT (-0400)
  Re: Q: plane equation  
From: Nathan Kopp
Date: 21 Dec 1998 21:30:33
Message: <367F0455.1A4D9441@Kopp.com>
You need the normal, and a distance along the normal:

#macro plane3pts(a,b,c)
  #local norm=vnormalize(vcross(b-a,c-a));
  #local dst=vdot(a,norm);
  plane{norm, dst}
#end

You may want to change the first line of the macro to (negate norm):
  #local norm=-vnormalize(vcross(b-a,c-a));

One way will use right-hand-rule, the other left-hand-rule (counter-clockwise
vs clockwise order of points)... I'm not sure which is which, though. ;-)

-Nathan Kopp


Post a reply to this message

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