// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Build a stable local frame // Not compiled or tested in-world // Setup: Use a spare owned prim. Edit FORWARD and UP_HINT. Touch for owner-only results. // Stop / restore: Disable/remove. No scene properties change. // Notes: Parallel up hints require a fallback axis; the resulting frame may not retain the original roll. // License: see LICENSE in this distribution. // Original Incoprea. MIT. vector FORWARD=<1.0,2.0,0.4>; vector UP_HINT=<0.0,0.0,1.0>; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(llVecMag(FORWARD)<0.000001) { llOwnerSay("Zero forward vector."); return; } vector f=llVecNorm(FORWARD); vector left=UP_HINT%f; if(llVecMag(left)<0.000001) { vector fallback=<0.0,1.0,0.0>; if(llFabs(f.y)>0.9)fallback=<1.0,0.0,0.0>; left=fallback%f; } left=llVecNorm(left); vector up=f%left; rotation r=llAxes2Rot(f,left,up); llOwnerSay("Forward="+(string)f+" left="+(string)left+" up="+(string)up+" rotation="+(string)r); } }