vendredi 30 décembre 2016

Ease of Motion, Programming Tweening, c++

Tweening is a video editing term used to describe ease of motion. For example, with an elevator the lift does not go full speed and dead stop when it reaches it's desired floor. It knows what floor its on, what floor it is going to, and how long it will take to get there. Then it uses that data to smooth its motion.

I would like to be able to program this smooth motion for my projects by using tweening.

The method for how to do this is layed out in http://ift.tt/2ineIQk

Specifically looking at pg207-211

This guide explains what tweening is and then shows code in Action Script. To be honest I feel kind of stupid becuase I've tried to use the examples provided but I can't seem to replicate it in another language such as c++, java, javascript, or lua.

I do not wish to use a package or plugin to code tweening, I want to learn how to actually code a tweening function. So if anyone with better comprehension skills, or programming skills, thinks they understand then I would very much appreciate an explanation.

Sample Action script functions...

Math.easeInQuad = function (t, b, c, d) {
return c*(t/=d)*t + b;
};

Math.easeOutQuad = function (t, b, c, d) {
return -c * (t/=d)*(t-2) + b;
};

Math.easeInOutQuad = function (t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
};

Aucun commentaire:

Enregistrer un commentaire