Re:A Quick Look Into The Math Of Animations With JavaScript
by unwind on Tuesday October 04, 2011 @05:34PM
(#3073017)
Very classical material, especially if you've ever been (as the author) writing demos/intros in the 80s/90s (http://en.wikipedia.org/wiki/Demoscene). I have many memories of writing basic programs that spat out sine tables, since it wasn't possible to compute something as complex as a sine in real-time.
[ Parent
| on HN ]
Re:A Quick Look Into The Math Of Animations With JavaScript
by gord on Wednesday October 05, 2011 @12:35AM
(#3074239)
yes, I much enjoyed flipcode.com back in the day, particularly Alex Champandards series - http://www.flipcode.com/archives/The_Art_of_Demomaking-Issue...
I played with Javascript sine animations as a way of introduce the idea of sine function in some intuitive way.
Eg Two Rotating Circles - http://quantblog.wordpress.com/2011/10/05/adding-circles-jav...
I think Javascript hacking in a web page is todays equivalent to hacking GW-Basic, Turbo Pascal or A86 assembler for my generation.
Re:A Quick Look Into The Math Of Animations With JavaScript
by unwind on Tuesday October 11, 2011 @09:16AM
(#3098389)
Of course, back in (my) day, the web didn't exist, so there was no flipcode.com. :| Now off to trim the lawn.
Re:A Quick Look Into The Math Of Animations With JavaScript
by thaumaturgy on Tuesday October 04, 2011 @06:04PM
(#3073123)
Yep, and they're still useful: I use a logarithmic computation for fading elements in and out with JavaScript, and by pre-computing the values for each step and storing them in an array, the fade still looks smooth even on older hardware.
Re:A Quick Look Into The Math Of Animations With JavaScript
by joahua on Tuesday October 04, 2011 @09:45PM
(#3073773)
I'd love to see this in action - do you have a link? Do you literally serve a precomputed array as part of the JS and iterate over that using opacity/IE filter/whatever, or is it more nuanced than that?
Re:A Quick Look Into The Math Of Animations With JavaScript
by thaumaturgy on Tuesday October 04, 2011 @10:30PM
(#3073900)
Sure: http://shomi.associatedtechs.com/
It's not precomputed server-side, it's precomputed when the fade effect is called in the JS. The value for each step is then stored in the task object that performs the fade. Which is cheating a little bit, I suppose, but this way, I can fade from any value to any value, at what appears to be the same "speed", without any glitching.