Add existing SVG or HTML5 Elements to a Box2D World

I have an SVG logo made up predominatly of elements. I want to animate this, or more specifically drop it into a "gravity world". I was hoping to use Box2D (web port). I'm a noob to Box2D and Canvas really, but I've got as far as converting my SVG into HTML5 canvas using [canvg](http://code.google.com/p/canvg/) and I'm now reading through the getting started tutorials for Box2dWeb and I can see how to create a world with gravity, but I can't find any examples of walking an existing SVG or Canvas and simply adding the shapes to that world. It looks like you need to use the Box2D drawing methods. Can anyone point me at a simple example that takes an *existing* set of shapes (SVG or on Canvas) and simply drops them onto a Box2DWeb gravity world so they simply collapse to the bottom, much like nearly all the existing Box2D demos and tutorials? Note that with CanVG I'm not adding the shapes to Canvas myself, it is creating the Canvas for me from the SVG.

以上就是Add existing SVG or HTML5 Elements to a Box2D World的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏