// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Blend nearby rotations with normalized interpolation // Not compiled or tested in-world // Setup: Use a spare owned prim. Set two Euler poses and T0..1. Touch for private calculations. // Stop / restore: Disable/remove. No camera or object settings are changed. // Notes: Normalized linear interpolation is not constant angular speed. It is useful for inexpensive blends of nearby orientations. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Transform planning only. vector START=<0.0,0.0,10.0>; vector END=<20.0,30.0,50.0>; float T=0.4; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(T<0.0||T>1.0) { llOwnerSay("T must be0..1."); return; } rotation a=llEuler2Rot(START*DEG_TO_RAD); rotation b=llEuler2Rot(END*DEG_TO_RAD); float dot=a.x*b.x+a.y*b.y+a.z*b.z+a.s*b.s; if(dot<0.0)b=<-b.x,-b.y,-b.z,-b.s>; rotation q=; float length=llSqrt(q.x*q.x+q.y*q.y+q.z*q.z+q.s*q.s); if(length<0.000001) { llOwnerSay("Degenerate quaternion blend."); return; } q=; llOwnerSay("Normalized blend="+(string)q); } }