// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Fill a panel and calculate image crop // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set image width/height and panel width/height. Touch for owner-only output. // Stop / restore: Remove/disable. The script calculates only; no scene properties change. // Notes: The crop assumes centered image alignment. Applying UV values depends on the actual face mapping and texture conventions. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. float IW=1920.0; float IH=1080.0; float PW=3.0; float PH=4.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(IW<=0.0||IH<=0.0||PW<=0.0||PH<=0.0) { llOwnerSay("Positive dimensions required."); return; } float scale=PW/IW; if(PH/IH>scale)scale=PH/IH; float u=PW/(IW*scale); float v=PH/(IH*scale); llOwnerSay("Visible UV span="+(string)+"; minimum UV="+(string)<(1.0-u)*0.5,(1.0-v)*0.5,0.0>); } }