I tried doing that and didnt get it to work, never even heard of "lerp" lolSulunia wrote:Instead of directly defining certain values, such as the Y position of the blocks in the blockbreaker example, you instead use a math function to set this value indirectly.would beCode: Select all
BlockY = 30
In this case, instead of simply appearing at the Y = 30 position, the block would slide down until it's Y was equal to 30.Code: Select all
BlockY = 0 --define this in the load BlockY = lerp(BlockY, 30, 0.05 ) -- make sure you run this inside the update
Anyone need help with small projects?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Anyone need help with small projects?
Re: Anyone need help with small projects?
AMD Radeon R9 270xHaftSwimmingly wrote:May I ask what graphics card you have?Vimm wrote:Yeah I'm that guy...Sulunia wrote:
I think he's the one who mentioned on some other thread his video card is glitchy, and stuff simply doesn't run well.
Re: Anyone need help with small projects?
More information about "lerp" can be found here: (https://en.wikipedia.org/wiki/Linear_interpolation).Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
The example attached features a very simple utilisation of such effect.
- Attachments
-
- lerp.love
- Use love 0.10.1 plis
- (551 Bytes) Downloaded 68 times
Last edited by Sulunia on Fri Apr 08, 2016 9:34 pm, edited 1 time in total.
https://github.com/Sulunia
Re: Anyone need help with small projects?
Sulunia wrote:"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
The example attached features a very simple utilisation of such effect.
totally didn't spend like 15 minutes pretending the square was chasing me...
also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.
Re: Anyone need help with small projects?
I suggest you watch the video i linked in my first answer. It shows you how to make good usage of such effects to improve overall game looks even with the simplest graphics.Vimm wrote:Sulunia wrote:"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
The example attached features a very simple utilisation of such effect.
totally didn't spend like 15 minutes pretending the square was chasing me...
also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.
https://github.com/Sulunia
Re: Anyone need help with small projects?
Sulunia wrote:I suggest you watch the video i linked in my first answer. It shows you how to make good usage of such effects to improve overall game looks even with the simplest graphics.Vimm wrote:Sulunia wrote:
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).
The example attached features a very simple utilisation of such effect.
totally didn't spend like 15 minutes pretending the square was chasing me...
also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.
yeah i watched it when you posted it, my goal rn is to get a ball to fall from the top to the bottom, go past the bottom then bounce back up like in the video (shown at roughly 4:50)
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Anyone need help with small projects?
If you ever will, then do tell me, and please make it modular/easily programmable to get information via different APIs per-site, since it'd help people's (or at least my) productivity if such a thing existed (no more forgotten updates from people, direct feeds combined into one app, even for sites not having feeds per-se.)Sulunia wrote:Actually, i had an idea after watching "the matrix" again. I thought about using love2d to create a "matrix console", which would get information from a lot of different websites and spit it out on the console in realtime.zorg wrote:Something about windowless löve...
Quite useless, yes, but i would use threads to gather data and also would improve parsing skills/JSON, aswell as providing me with a nice "screensaver".
Currently i won't pull it off since i got my hands full with BeatFever though.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Anyone need help with small projects?
Well, to be precise, that one is not linear. Linear would have constant velocity, not go slower when it's near the destination. That one is exponential, actually.Sulunia wrote:"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
The example attached features a very simple utilisation of such effect.
To have linear interpolation you need to put both the origin and the destination points in the function call, and iterate using a parameter 't' to make it go from 0 to 1 in constant steps, and both origin and destination would always stay the same during the process, without feeding the output back as an input. It returns a point between origin and destination proportionally to 't'. For example, when t = 0.5 it returns the midpoint.
I know, it's duller But by playing with blending functions (i.e. by changing t in between) you can actually get interesting results that are no longer linear. Rebound effects, acceleration/deceleration at ends, and so on.
Re: Anyone need help with small projects?
I see. I'll fix my post then!pgimeno wrote:Well, to be precise, that one is not linear. Linear would have constant velocity, not go slower when it's near the destination. That one is exponential, actually.Sulunia wrote:"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
The example attached features a very simple utilisation of such effect.
To have linear interpolation you need to put both the origin and the destination points in the function call, and iterate using a parameter 't' to make it go from 0 to 1 in constant steps, and both origin and destination would always stay the same during the process, without feeding the output back as an input. It returns a point between origin and destination proportionally to 't'. For example, when t = 0.5 it returns the midpoint.
I know, it's duller But by playing with blending functions (i.e. by changing t in between) you can actually get interesting results that are no longer linear. Rebound effects, acceleration/deceleration at ends, and so on.
https://github.com/Sulunia
Re: Anyone need help with small projects?
I tried looking into that, but I think most references about how to do it are outdated, whenever I follow tutorials and the such on sound synthesis I just get errors, even when i copy and paste the code to be sure.kikito wrote:Notice that you don't necessarily need graphics to make cool stuff. You could, for example, investigate sound synthesis - maybe doing synth music. I remember seeing some threads about it some time ago. It's a road few people take, because there's some math and sound is less "flashy" than graphics. But it might suit you.
Who is online
Users browsing this forum: No registered users and 3 guests