Understood
Thanks
Emmanuele Bassi wrote:
On Tue, 2009-03-10 at 11:46 -0400, Vlad Seryakov wrote:
It seems kind of complicated for convenient functions.
uh? the convience was all in using symbols -- and that hasn't gone away,
but it has been improved (since now you can register new easing modes
globally).
instead of using our own homegrown easing functions, we decided to move
to more general (and generally used) easing functions.
the smoothstep does not really map into the easing modes, since it's an
"in-out" only mode; it's also approximated by the rest of the easing
modes we provide.
What was the reason to remove usefull functions and replace them with other
usefull but not keep all?
the easing functions in Clutter are the same used by other animation
frameworks and toolkits, like the tweener ActionScript and JavaScript
libraries, and jQuery. a lot of people are already familiar with them,
and if you look for sample animations it's far easier to find something
using an easing, in-out cubic mode than a smoothstep one.
ciao,
Emmanuele.
Emmanuele Bassi wrote:
On Mon, 2009-03-09 at 22:50 -0400, Vlad Seryakov wrote:
What is the analog of clutter_smoothstep_inc_func in the latest Git version?
there is no equivalent.
the equation for the increasing variant of the smoothstep function is:
f(x) = -2x^3 + 3x^2
so you probably want a cubic easing - the EASE_IN_OUT_CUBIC is similar
in progress to the smoothstep across the [ 0, 1 ] interval.
*or*, you can write your own function, like this:
static gdouble
my_smoothstep_inc (ClutterAlpha *alpha,
gpointer data)
{
ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha);
gdouble progress = clutter_timeline_get_progress (timeline);
/* always defined within [ 0, 1 ] */
return -2.0 * (pow (progress, 3)) + 3.0 * (pow (progress, 2));
}
and then register it as a global alpha function, for instance inside an
initialization function of your project:
extern gulong MY_SMOOTHSTEP_INC;
MY_SMOOTHSTEP_INC = clutter_alpha_register_func (my_smoothstep_inc,
NULL);
you can then reuse MY_SMOOTHSTEP_INC across your project when creating
new ClutterAlpha instances or when using the clutter_actor_animate()
implicit animation API.
ciao,
Emmanuele.
--
To unsubscribe send a mail to [email protected]