Hello dear community of C2
I have a complex (for me) maths problem that I can't wrap my head around... I think it must involve using lerp(a,b,x) but I'm not quite sure how to achieve this..
I have two objects. Object A must influence Object B.
Object A moves from speed 0 to 100
Object B has a size of 36 x 36
Now I want the size of Object B to adapt according to the speed of Object A on a scale.
The fastest Object A goes, the flattest and widest Object B gets. when Object A's speed is maximum (100) Object B must have a width of 150 from initial width of 36
and height of 3 from initial height of 36 (kinda like a jelly cube which would flatten and spread then go back to its original size.
So when Object A's speed = 0 Object B size = 36 x 36. When object A's speed is 100 then Object B size = 150 width x 3 height
Which gives us:
OBJECT A SPEED RANGE: 0___________________________________100
OBJECT B WIDTH RANGE: 36_________________________________150
OBJET B HEIGHT RANGE: 36__________________________________3
If Object A's speed = 50, then Object B Width should be 57 and Height 16,5. How can I obtain both those numbers dynamically? I'm pretty sure lerp must be used..
I'm not sure if the example I've used is very clear. My brain is melting even tho I suspect it's not THAT complicated