[Javascript] animation algorithm
Billy Reisinger
billy.reisinger at gmail.com
Mon Mar 12 19:41:53 CDT 2007
One - half of a sine wave's period traces a nice curve, close enough
to the bell curve for animation easing. That would be a really
simple algorithm to use. If you really want fine grained control
over the easing, I suggest using a Bezier curve. If you google
"Bezier curve javascript", you are likely to find a ton of
resources. Heck, you can probably cut/paste something pretty readily
- this is one of those oft-solved (and interesting) programming
puzzles. Actually, I think i have a link.... ah: http://pupius.co.uk/
download/articles/bezier_curves/
Enjoy!
On Mar 12, 2007, at 1:27 PM, Anthony Ettinger wrote:
> I have a pretty simple idea to pan an element within it's parent.
>
> I'm having trouble coming up with an algorithm that would ease in/out
> of the far left or far right position, relative to it's parent.
>
> I want a basic bell curve, but am having a heck of a time getting my
> calculations correct.
>
> the variables I have to work with are positions of the mouse, the
> static container element and it's width, and the position of the child
> element that will be moved and it's width.
>
> Please help.
>
> --
> Anthony Ettinger
> Ph: 408-656-2473
> http://chovy.dyndns.org/resume.html
> http://utuxia.com/consulting
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list