Use Canvas in SVG or WebGL for 3D application

后端 未结 1 1577
梦毁少年i
梦毁少年i 2021-01-06 06:46

I need to build an html5/javascript 3d application, and each scene i have to render a lot of objects (about 200-300 complex objects or more) without lagging, so please tell

相关标签:
1条回答
  • HTML5 / Canvas / SVG are good for static images, but not for a 3D application that allows movements.

    HTML5 and SVG do not implement 3D mechanisms, so creating such scene could become quickly terribly complex. Canvas are only some kind of surface, which would require further logic or techniques for drawing on it.

    Another consideration is that different browsers may have very different performance, for instance (at the moment I write this answer) comparing Chromium and Firefox, one is better at moving one huge image, while the other is better at moving thousands of small ones.

    WebGL is a simplification of OpenGL for web, which use the graphic card for rendering complex scenes, like in games. This would allows real 3D and realistic rendering. The price is complexity: it take some time to learn and apply correctly.

    For simple 3D effects and styling, WebGL is an overkill, and SVG would be a simpler alternative. For real 3D, WebGL gives the full power.

    0 讨论(0)
提交回复
热议问题