what is lerp? (2 minute tutorial for the non-math

Post your own tutorials, guides and demos.

Post » Sun Apr 17, 2011 4:26 pm

[quote="alastair":1qf8fnnx]Thanks Lucid, I understand it, just don't think it will be useful for anything. Things like health bars are already easy to do with variables, just subtract/add.[/quote:1qf8fnnx]
this is what I meant by health bar:
http://dl.dropbox.com/u/1013446/lerpbar.cap

you could make a much cooler more complex one, but I wanted to keep it simple. your health goes up the higher your mouse is on the screen. Also, you can resize the health bar, change the screensize, etc, and this same code will still work, with no changes whatsoever


here's tulamide's example again, but using a few extra lerps in some other ways. You can change the global variable 'numberofballs' in start of layout, and you'll notice they always perfectly space apart and behave correctly, and the color blend works perfectly regardless of position. Something like this would be impossible without lerp, or some mathematical equivalent:
http://dl.dropbox.com/u/1013446/tulerpmide.cap


[quote="DtrQ":1qf8fnnx]It's nice plugin, but I prefer to don't use plugins if goal can be reached with events. I think there must be way to do it with pure Construct[/quote:1qf8fnnx]
everything in construct is a plugin. every object and behavior is created with the same sdk. the only difference is some are official plugins made by ash, davo, and rich, and some aren't. I can definitely respect wanting to understand the math well enough to do it without the new plug, and tulamide already showed how, but avoiding using the faster way once you do understand it is kinda pointless, imho. Especially since in circumstances where it takes more than one construct expression to achieve it, the plugin will always be faster, both in the time you take to write and read your own code, but also in the execution speed, as the c++ within a plugin runs faster than construct's interpreted expressions. that speed difference won't matter in most caps, but good to know anyway
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Apr 17, 2011 5:24 pm

[quote="lucid":48t9ilxz]
everything in construct is a plugin. every object and behavior is created with the same sdk. the only difference is some are official plugins made by ash, davo, and rich, and some aren't. I can definitely respect wanting to understand the math well enough to do it without the new plug, and tulamide already showed how, but avoiding using the faster way once you do understand it is kinda pointless, imho. Especially since in circumstances where it takes more than one construct expression to achieve it, the plugin will always be faster, both in the time you take to write and read your own code, but also in the execution speed, as the c++ within a plugin runs faster than construct's interpreted expressions. that speed difference won't matter in most caps, but good to know anyway[/quote:48t9ilxz]
I know it all, main reason why I don't want to use 3rd party plugins without extreme need is most of them are unstable and buggy. And even if this one is pretty stable I still want to know how to do things without plugs.
Bad news for me is that I'm not very good at math :(
B
2
S
2
G
2
Posts: 158
Reputation: 1,366

Post » Sun Apr 17, 2011 6:56 pm

[quote:2m0f0d3x]I know it all, main reason why I don't want to use 3rd party plugins without extreme need is most of them are unstable and buggy. And even if this one is pretty stable I still want to know how to do things without plugs.
Bad news for me is that I'm not very good at math :([/quote:2m0f0d3x]

Yeah, but the event solution is not exactly practical... math wise, as it's a workaround for a.... ehh, lets call it a feature rather than a bug.
Image Image
B
161
S
48
G
89
Posts: 7,345
Reputation: 66,245

Post » Tue Nov 01, 2011 12:37 pm

the first link is broken =(TELLES08082011-11-01 12:37:36
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,187
Reputation: 18,261

Post » Tue Nov 01, 2011 12:46 pm

@TELLES0808
The original thread is HERE with working download.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,838
Reputation: 48,277

Post » Tue Nov 01, 2011 1:28 pm

Thanks xD
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,187
Reputation: 18,261

Post » Tue Nov 01, 2011 9:06 pm

Um... no idea if anyone asked for this before I did, but can you put up a qarp tutorial for us math newbies as well? I never really understood what that was all about, myself.

Other good tutorials for game math would be modulus and... lessee... well, I dunno. The Sine behavior would be great, I think.
B
8
S
2
G
6
Posts: 44
Reputation: 3,007

Post » Tue Nov 08, 2011 1:32 pm

Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Nov 10, 2011 7:32 pm

Is there any change that you would share a simple capx where you apply a simple LERP?
Where you would say A is bla bla bla, B bla bla bla, in other words, where you explain in noob language.

Thanks =)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Tue Aug 28, 2012 4:17 pm

I was reading this thread and I noticed that the sample files were pre C2. This is possibly the solution I'm looking for and would like to get a more understanding of this plugin.

Is it possible to have updated sample files so we can see this in C2?
B
31
S
6
G
4
Posts: 160
Reputation: 5,998

PreviousNext

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest