|
![](/i/fill.gif) |
clipka <ano### [at] anonymous org> wrote:
>
> * Take two arbitrary vectors along the triangle plane - the edges are
> ideally suited for this purpose ;-):
>
> #declare A = V2-V1;
> #declare B = V3-V1;
>
> * Compute the cross product, which will give you a vector perpendicular
> to the two vectors (its length will depend on the length of the vectors
> and the angle between them):
>
> #declare C = vcross(A,B);
>
> * Normalize the result to get a unit-length vector:
>
> #declare N = vnormalize(C);
>
> * Voila!
>
> Make sure that the three vertices of the triangle are in the right
> order, as this will determine whether the resulting vector will point
> inwards or outwards.
>
> Also make sure your triangles are all "sane", i.e. all vertices are at
> different coordinates. But you probably guessed this constraint already ;-)
Well... my macro still generates some "insane" triangles but yeah, already
working on fixing it. THANKS A LOT FOR THE HELP!!
Post a reply to this message
|
![](/i/fill.gif) |