Skip to content

Conversation

@Soares
Copy link
Contributor

@Soares Soares commented Jan 29, 2013

Very useful when you want to create e.g. a continuous rotating graph. Now you
can do:

var n = 0;
var duration = 1000;
var spin = function() {
mathbox.animate('surface', {
worldRotation: [0, 0, n++ * τ]
}, {
duration: duration,
ease: 'linear'
});
setTimeout(spin, duration);
};
spin();

For a continuous spin. I'd still like to see better support for this, but full
support would require allowing properties (such as worldRotation above) to be
functions that return the new result instead of being values.

Very useful when you want to create e.g. a continuous rotating graph. Now you
can do:

var n = 0;
var duration = 1000;
var spin = function() {
  mathbox.animate('surface', { worldRotation: [0, 0, n++ * τ] }, { duration: duration, ease: 'linear' });
  setTimeout(spin, duration);
};
spin();

For a continuous spin. I'd still like to see better support for this, but full
support would require allowing properties (such as worldRotation above) to be
functions that return the new result instead of being values.
@unconed
Copy link
Owner

unconed commented Feb 9, 2013

I do plan to rearchitect mathbox so that expressions can be used everywhere, it is indeed the only logical outcome. This is a bit tricky to do though, because expressions should be able to return individual values rather than being expected to return an entire data array.

In your case though, you could easily just queue up an unreasonably long animation (e.g. 10 minutes) rather than repeating a short one over and over again.

For continuous animations, I do find it handier to use director.clock() on live expressions.

In the meantime, there's no harm in having linear easing though, so I'm happy to include it.

unconed added a commit that referenced this pull request Feb 9, 2013
Added linear easing to animations.
@unconed unconed merged commit d78b3c8 into unconed:master Feb 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants