Schroedingers-Hat / jsphys

Libraries for physics simulation on javascript canvas
GNU Affero General Public License v3.0
11 stars 1 forks source link

Make embeddable version of jsphys #52

Open capnrefsmmat opened 13 years ago

capnrefsmmat commented 13 years ago

Make an easily-embeddable version that can fit in an iframe. Let the embedder choose the canvas size, UI display, demo to load, and autoplay.

The goal is to facilitate a webpage that says "and the ladder paradox looks like this:" with a premade demo that plays and shows explanatory captions. Interactive textbooks!

Schroedingers-Hat commented 12 years ago

@capnrefsmmat How is this going global-exorcism wise?

capnrefsmmat commented 12 years ago

AFAIK the only changes we need now are size changes -- the default viewer is 500px high, but if I embed it, I may want it to be a different size, and so it needs to adapt to various heights. Easy enough to fix.

Then we'll want a way to specify various UI defaults, like "hide the Minkowski diagram for this embedding".

All the global variables are pretty much exorcised, since scene is now a local variable stored in closures.

Schroedingers-Hat commented 12 years ago

All the global variables are pretty much exorcised, since scene is now a local variable stored in closures. Speaking of which, I should check that I remove that when I'm not using it, or put it with the debug code -- I put a global reference in so I could find the damn thing for debugging. It may have slipped by

capnrefsmmat commented 12 years ago

I'll build the debug switch into jsphys today, I guess. I'll give you a global scene when you turn on debugging, if I can find a good way to do that.

Schroedingers-Hat commented 12 years ago

if you find a place to execute (!window.scene) ? window.scene = scene : somewhere