Lerp: The good, the bad, and the average

Post your own tutorials, guides and demos.

Post » Fri Jul 10, 2009 8:36 pm

ordinary arithmetic operations should be ultraquick, though, and adding an extra addition or division sign in an equation shouldn't make any difference
I could be wrong, but I think you should probably run into your cpu bottlenecking because of the event system much sooner than because of math in most cases
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Jul 11, 2009 11:55 am

B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Wed Jul 15, 2009 1:59 pm

http://en.wikipedia.org/wiki/Bzier_curve

wikipedia has a great article explaining beziers for anyone whos interested, it covers basic linear interpolation aswell.

using Qarp(a,b,c,t) and Cubic(a,b,c,d,t) will respectively do quadratic and cubic bezier curves
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Wed Jul 15, 2009 3:43 pm

Ah nice find Quasi.


Where P, P1, P2, and T would be a, b, c, and t.
qarp(P,P1,P2,T)
Here's an example in use.
[url:1anyvdp7]http://files.getdropbox.com/u/666516/qerpaderp.cap[/url:1anyvdp7]
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Aug 13, 2009 9:39 pm

That was a really good way to use it newt! It was awsome that you could move it in realtime too!
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Thu Aug 13, 2009 9:57 pm

Yeah, quarp was originally included for that reason :)!
[size=70:3bcdwykc](I requested the feature :B)[/size:3bcdwykc]
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Thu Aug 13, 2009 10:55 pm

[quote="Drasa":2g97v018]Yeah, quarp was originally included for that reason :)!
[size=70:2g97v018](I requested the feature :B)[/size:2g97v018][/quote:2g97v018]

[quote="Attan":2g97v018]That was a really good way to use it newt! It was awsome that you could move it in realtime too![/quote:2g97v018]

Thanks, and thanks.

Yeah its great way to do custom movements. The possibilities are almost limitless, but don't forget you can use it on other things besides movement, there's zooming, opacity, scrolling...etc.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Aug 14, 2009 4:01 pm

Yeah, cubic was originally included for that reason :)!
[size=70:3odprjel](I requested the feature :B)[/size:3odprjel]

:P
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Aug 16, 2012 12:51 pm

Thx for this Sorry for resurrecting old post but this was gr8!

I made this real quick ^^

http://dl.dropbox.com/u/53738503/Lerp/index.htmlSchoening2012-08-16 12:52:03
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Mon Oct 01, 2012 12:15 pm

Great Tutorial :) I liked It!!!
B
2
Posts: 1
Reputation: 252

PreviousNext

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest