Discuss Scratch

PayPayFriday
Scratcher
48 posts

Lerp Block

Hi! I was wondering if you could add a lerp block in a new tab called “Numbers”. I'll show you what I want it to look like:
(lerp from (...) to (...) % (50) :: #74bc76
Here is the block code:
(lerp from (…) to (…) % (50) :: #74bc76
Za-Chary
Scratcher
1000+ posts

Lerp Block

What does “lerp” mean in this context, and how can it be used?
Myst--
Scratcher
100+ posts

Lerp Block

Za-Chary wrote:

What does “lerp” mean in this context, and how can it be used?
Like Za-Chary said, I am confused about what this block would do. What does lerp mean?
-gr
Scratcher
1000+ posts

Lerp Block

Za-Chary wrote:

What does “lerp” mean in this context, and how can it be used?

Myst-- wrote:

Like Za-Chary said, I am confused about what this block would do. What does lerp mean?

I'm confused as well.
Kitt-Draw
Scratcher
1000+ posts

Lerp Block

You want a block to be an insect?

tbh I'm confused
lolecksdeehaha
Scratcher
1000+ posts

Lerp Block

Za-Chary wrote:

What does “lerp” mean in this context, and how can it be used?
Tweening values. I'd assume you'd use a time limit instead of a percentage. Think the glide block, but a specific value.
My version of it:
(lerp from (…) to (…) for (2) secs :: #74bc76)
Super_Scratch_Bros20
Scratcher
1000+ posts

Lerp Block

lolecksdeehaha wrote:

Za-Chary wrote:

What does “lerp” mean in this context, and how can it be used?
Tweening values. I'd assume you'd use a time limit instead of a percentage. Think the glide block, but a specific value.
My version of it:
(lerp from (…) to (…) for (2) secs :: #74bc76)

Oh, okay.

If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.
lolecksdeehaha
Scratcher
1000+ posts

Lerp Block

Super_Scratch_Bros20 wrote:

lolecksdeehaha wrote:

~snip~

Oh, okay.

If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.
Here's some I thought of:
  • tween from () to () for () secs
  • smooth change from () to () for () secs
  • tween value smoothly from () to () for () secs
Some are a bit long, however.
Super_Scratch_Bros20
Scratcher
1000+ posts

Lerp Block

lolecksdeehaha wrote:

Super_Scratch_Bros20 wrote:

lolecksdeehaha wrote:

~snip~

Oh, okay.

If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.
Here's some I thought of:
  • tween from () to () for () secs
  • smooth change from () to () for () secs
  • tween value smoothly from () to () for () secs
Some are a bit long, however.

You know what? I have a better solution.

glide () seconds from x: () y:() to x: () y: () ::motion
lolecksdeehaha
Scratcher
1000+ posts

Lerp Block

Super_Scratch_Bros20 wrote:

lolecksdeehaha wrote:

~snip~

You know what? I have a better solution.

glide () seconds from x: () y:() to x: () y: () ::motion
What? That's… not this suggestion though
Here, have a actually relevant definition for lerp
medians
Scratcher
1000+ posts

Lerp Block

-gr wrote:

Za-Chary wrote:

What does “lerp” mean in this context, and how can it be used?

Myst-- wrote:

Like Za-Chary said, I am confused about what this block would do. What does lerp mean?

I'm confused as well.
It’s a programming term.
PayPayFriday
Scratcher
48 posts

Lerp Block

dude in this case, i want the block to be
(lerp from (…) to (…) % (50) :: #74bc76
SpinningCube
Scratcher
100+ posts

Lerp Block

“lerp” is short for linear interpolation.

It's basically blending between two numbers

Here's a definition (not optimized):
define (lerp from (a::custom) to (b::custom) % (percentage::custom) :: operators
return ((((1) - ((percentage::custom) / (100))) * (a::custom)) + (((percentage::custom) / (100)) * (b::custom))) :: custom

Examples:
At 0%, number a is returned
At 100%, number b is returned
At 50%, the number halfway between a and b is returned
At 25%, the number 1/4 of the way from a to b is returned

Usually instead of 0% to 100% a number between 0 and 1 is used, but this could also work.

Last edited by SpinningCube (July 11, 2022 17:19:39)

Sliverus
Scratcher
1000+ posts

Lerp Block

Support, I think lerp blocks would quickly become my favorite blocks as they're so useful in mathematics

But if this gets implemented, don't change the name to something simple, keep calling it lerp
PayPayFriday
Scratcher
48 posts

Lerp Block

o k
ScolderCreations
Scratcher
1000+ posts

Lerp Block

I like this block and I think it would be very useful. However, I'm sure there's a better way to word it. Most people aren't going to understand what that means, so perhaps pick a name that makes it clear what it's doing?
musicROCKS013
Scratcher
1000+ posts

Lerp Block

Would there be a way to toggle between linear and nonlinear?
ScolderCreations
Scratcher
1000+ posts

Lerp Block

musicROCKS013 wrote:

Would there be a way to toggle between linear and nonlinear?
No. Math shouldn't have these kind of settings. It's math.
Sliverus
Scratcher
1000+ posts

Lerp Block

ScolderCreations wrote:

I like this block and I think it would be very useful. However, I'm sure there's a better way to word it. Most people aren't going to understand what that means, so perhaps pick a name that makes it clear what it's doing?
But lerp is funnier, and they can just ask about it to another Scratcher or in QAS
PayPayFriday
Scratcher
48 posts

Lerp Block

Yeah @Sliverus

Powered by DjangoBB