Page 1 of 1

[RESOLVED] Question about animations !

Posted: Sat Dec 26, 2015 11:23 am
by Linkpy
Hello everyone !

I'm working on a game which will have an editor. And, I want some animation within it, but when I say animation is keyframe'd animations (like in Unity 3D, Blender, or any other animation software).

I started to do the animation API within my game, but I'm blocked. Currently I've got 3 type of transition (I'm blocked with transition, so interpolating values between keyframes) : linear (with the lerp - linear interpolation), custom Bézier curves (with love.math.newBezierCurve and 2 points) and the last on is the cubic Bézier curves (so this is an equation : p0*(1-t)^3 + p1*t*(1-t)^2 + p2*(1-t)*t^2 + p3*t^3 ) but this one I wanted to do it like the CSS3 cubic-bezier(x0, y0, x1, y1) and I don't know how to apply this equation for 4 points (one at (0;0), the first control point (x0, y0), the second control point (x1, y1) and the last point (1, 1)).

So, can you help me ? I searched within the code of WebKit... But... Can't find where is done the calculation xD
Thanks you for your help !

Re: Question about animations !

Posted: Sat Dec 26, 2015 12:42 pm
by Linkpy
My bad ! I didn't done the right research on Google... :roll:

But, this can be useful for someone : http://devmag.org.za/2011/04/05/bzier-c ... -tutorial/
Using directly the equation can be faster than using the Löve's implementation of Bézier Curve.