I'm new to GL stuff (coming in via WebGL, with no direct OpenGL experience). Can we use PhysX with WebGL?
Asked
Active
Viewed 1,169 times
1 Answers
5
PhysX is a C++ API and can thus not directly be integrated with the JavaScript-based WebGL.
Depending on your needs, you have the following options:
- Use a JavaScript-based physics engine, mostly suitable for 2D use cases.
- Use a Game Engine that can export for the web (e.g. Unity 3D) and build your application in there, using full 3D physics capability. Keep in mind that this will probably require your users to install some additional Web Player and is not native WebGL.
Keep in mind that Game Engines may be a viable way for 2D applications too and can make your life a whole lot easier.
David Kuri
- 2,293
- 13
- 32
-
Unity can export to WebGL. – SurvivalMachine Aug 26 '16 at 14:34
-
Why are JavaScript-based physics engines "mostly suitable for 2D use cases"? Also you said "Keep in mind that Game Engines may be a viable way for 2D applications too and can make your life a whole lot easier", which is why I'm making http://github.com/infamous/infamous (renaming it soon and adding docs/demos). It's a 3D API that currently renders to DOM (CSS3D with my DOMMatrix polyfill), and I'd like to add WebGL soon. Here's a couple small demos: http://trusktr.io (hover on the left edge for the 3D menu) and http://mightydevs.com (letters moving into formation, needs word wrapping). – trusktr Aug 28 '16 at 00:53
-
@trusktr Because, or at least that's what I thought, there is no JS 3D physics engine that comes close to PhysX in terms of features. Then again I just found out that someone ported Bullet to JS. YMMV. – David Kuri Aug 28 '16 at 15:47