// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Triangle winding and area vector // Not compiled or tested in-world // Setup: Use a spare owned prim. Set three noncollinear vectors A/B/C. Touch for owner-only results. // Stop / restore: Disable/remove. No scene properties change. // Notes: Swapping two vertices reverses the normal; this does not inspect or change an actual mesh face. // License: see LICENSE in this distribution. // Original Incoprea. MIT. vector A=<0.0,0.0,0.0>; vector B=<4.0,0.0,1.0>; vector C=<1.0,3.0,2.0>; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; vector cross=(B-A)%(C-A); float magnitude=llVecMag(cross); if(magnitude<0.000001) { llOwnerSay("Degenerate triangle."); return; } llOwnerSay("Unit normal="+(string)(cross/magnitude)+"; area="+(string)(magnitude*0.5)); } }