[RESOLVED] Question about animations !

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Linkpy
Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

[RESOLVED] Question about animations !

Post 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 !
Last edited by Linkpy on Sat Dec 26, 2015 12:42 pm, edited 1 time in total.
Founder of NeoShadow Studio. Currently working on the project "Sirami".
github / linkpy
User avatar
Linkpy
Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

Re: Question about animations !

Post 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.
Founder of NeoShadow Studio. Currently working on the project "Sirami".
github / linkpy
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests