Misc trueSpace script

// https://rosettacode.org/wiki/Map_range
function MapRange(val,a1,a2,b1,b2)
{
	var val2 = Math.min(val,a2);
	s = Math.max(val2, a1);
	return b1 + (s-a1)*(b2-b1)/(a2-a1)
}

map range a1,a2 to b1,b2

RsAnim.PutFrame places a single item at a certain frame without affecting other items in the scene, useful for some “set driven key” type behaviors.

Leave a Reply

Your email address will not be published.