|
|
On Mon, 08 Nov 2004 21:26:38 +0000, Andrew the Orchid <voi### [at] devnull> wrote:
> What I want is a vector *perpendicular* to AB, but still in the same
> plane as the triangle... :-S
do a cross vector between triangle edges. This makes vector S perpendicular to
triangle. Now, do a cross vector between S and edge AB and you have vector to
AB and again on the plane of trinagle. Is that readable ?
Writing it blindly and without handling special cases:
#macro DoIt(A,B,V1,V2,V3) /* point and triangle */
#local AB = B-A;
#local P1 = V2-V1;
#local P2 = V3-V1;
#local S = vcross(P1,P2);
#local P = vcross(S,AB);
(P)
#end
ABX
Post a reply to this message
|
|