I'm starting a new project converting physics simulations(created in Adobe Director) to a more current platform namely html5 canvas or SVG. I would like to avoid Flash for a few reasons. I'm looking for recommendations and reasons why either canvas or SVG would fit this project best. I have read that SVG is better for interactivity which in this case is important but that it is not the best with animation. Canvas is better at animations but it struggles with interaction so I have heard. Does anyone have experience with the interaction side of canvas, is it really that difficult? Please advise. Thanks
Asked
Active
Viewed 1,936 times
3
-
I know that the Box2D canvas engine was ported to Javascript/canvas. Might be something that you want to check out. http://box2d-js.sourceforge.net/ – dave Sep 15 '10 at 15:54
-
Also https://developer.mozilla.org/en/Canvas_tutorial – dave Sep 15 '10 at 15:55
-
this is just an opinion: if i were doing physics simulations for the web i'd use something that crossed over to thick clients so I could have more flexibility later, like Java applet. If 3d is involved, i've seen neat demos of xaml being hosted in the browser. may i ask if these are on the web now? i'm just curious. – Aaron Anodide Sep 15 '10 at 15:58
-
@Dave, Thanks for the reply I looked in to that a bit. At the moment I'm leaning toward canvas because of these libraries that are popping up. I'm just not sure about interactivity. @Gabriel they are on the web just not publicly accessible. – tstrokes Sep 15 '10 at 16:06
2 Answers
1
Interactivity in canvas doesn't have to be all that difficult (there are quite a few js libraries out there to help you). And animation in svg is quite possible to do, see e.g svg-wow.org. Remember that you can mix and match svg and canvas as you see fit in order to use the strengths of each of these technolgies, as demonstrated here.

Erik Dahlström
- 59,452
- 12
- 120
- 139
-
Any direction or examples of the libraries one would use for interactions in canvas? – tstrokes Sep 16 '10 at 16:52
1
See this question for discussion of canvas frameworks and libraries:
What is the current state of the art in HTML canvas JavaScript libraries and frameworks?
A few of the canvas libraries listed replicate SVG in terms of object interaction to a fairly high standard. fabric.js looks particularly nice and is currently being actively developed.

Community
- 1
- 1

Castrohenge
- 8,525
- 5
- 39
- 66
-
1Thanks for directing me towards fabric.js looks exactly like what I will need. – tstrokes Sep 17 '10 at 14:30