Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] Physics "applets" in HTML5/JavaScript



John Denker wrote:
For example, I recently wrote
http://www.av8n.com/physics/wavefunctions.htm#sec-animation
which uses Javascript. I ported it from an older Java thing.
It uses somewhat-modern Javascript features. As others have
pointed out, the /canvas/ feature is crucial.

Does this applet depend on HTML5? I've never thought about
it. AFAICT it depends on semi-modern Javascript features
but not any bleeding-edge HTML features.
Thanks, John--that's exactly the sort of thing I was looking for. It's good to know that others are adopting this technology. And I know I could have worked harder on my Google incantations. The canvas element is definitely considered part of HTML5. When I said "HTML5" I really meant "canvas"; the only other HTML5 feature I've used is the slider control ("input type=range"), which I find extremely handy though unfortunately it's not yet supported by Firefox or by several of the mobile browsers.
Also, I enjoy seeing quantitatively-correct righteous
electron probability distributions, as opposed to the
kooky "artist's impressions" that you all-too-often
see in the literature.
Have you seen Falstad's fantastic hydrogen wavefunction applet (modeled on Dauger's old Mac program, now ported to an iOS native app)? Falstad's applet is here: http://falstad.com/qmatom/
Seriously, rather than writing a physics engine from
scratch for research and/or educational purposes, I
would strongly recommend you at least /consider/
the idea of co-opting an open-source game platform.
I'm not saying it will be exactly what you need,
but there should be something like 80% commonality.

There's no way that a game development "physics" library is going to include 80% of what I want. But yeah, for projectile motion and collisions, I'm sure it would be quite powerful.
Dan