<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=Interpolation%2FExamples</id>
	<title>Interpolation/Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=Interpolation%2FExamples"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Interpolation/Examples&amp;action=history"/>
	<updated>2026-06-09T04:48:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Interpolation/Examples&amp;diff=75035&amp;oldid=prev</id>
		<title>Nexii Malthus: Created new example script for interpolation library</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Interpolation/Examples&amp;diff=75035&amp;oldid=prev"/>
		<updated>2008-06-27T19:24:08Z</updated>

		<summary type="html">&lt;p&gt;Created new example script for interpolation library&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Moves linearly upwards, then slides down speeding up and slowing down as well, then it takes a curvy path using a cubic curve to the beginning. Each step activated with a touch to show it in practice.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
vector vLin(vector v0, vector v1,float t){&lt;br /&gt;
    return v0*(1-t) + v1*t;}&lt;br /&gt;
&lt;br /&gt;
vector vCos(vector v0,vector v1,float t){&lt;br /&gt;
    float F = (1 - llCos(t*PI))/2;&lt;br /&gt;
    return v0*(1-F)+v1*F;}&lt;br /&gt;
&lt;br /&gt;
vector vCub(vector v0,vector v1,vector v2,vector v3,float t){&lt;br /&gt;
    vector P = (v3-v2)-(v0-v1);vector Q = (v0-v1)-P;vector R = v2-v0;vector S = v1;&lt;br /&gt;
    return P*llPow(t,3) + Q*llPow(t,2) + R*t + S;}&lt;br /&gt;
&lt;br /&gt;
default{&lt;br /&gt;
    touch_start( integer d ){&lt;br /&gt;
        vector A = llGetPos();&lt;br /&gt;
        vector B = A + &amp;lt; 0, 0, 2&amp;gt;;&lt;br /&gt;
        &lt;br /&gt;
        float x;&lt;br /&gt;
        while( x &amp;lt;= 1.0 ){&lt;br /&gt;
            llSetPos( vLin( A, B, x += 0.05 ) );&lt;br /&gt;
        }&lt;br /&gt;
        state Two;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state Two{&lt;br /&gt;
    touch_start( integer d ){&lt;br /&gt;
        vector A = llGetPos();&lt;br /&gt;
        vector B = A + &amp;lt; 2, 0,-2&amp;gt;;&lt;br /&gt;
        &lt;br /&gt;
        float x;&lt;br /&gt;
        while( x &amp;lt;= 1.0 ){&lt;br /&gt;
            llSetPos( vCos( A, B, x += 0.05 ) );&lt;br /&gt;
        }&lt;br /&gt;
        state Three;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state Three{&lt;br /&gt;
    touch_start( integer d ){&lt;br /&gt;
        vector A = llGetPos();&lt;br /&gt;
        vector B = A + &amp;lt;-2, 0, 0&amp;gt;;&lt;br /&gt;
        vector C = A + &amp;lt; 0, 4, 0&amp;gt;;&lt;br /&gt;
        vector D = A + &amp;lt;-2,-4, 0&amp;gt;;&lt;br /&gt;
        &lt;br /&gt;
        float x;&lt;br /&gt;
        while( x &amp;lt;= 1.0 ){&lt;br /&gt;
            llSetPos( vCub( C, A, B, D, x += 0.05 ) );&lt;br /&gt;
        }&lt;br /&gt;
        state default;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nexii Malthus</name></author>
	</entry>
</feed>