x3dom / x3dom

X3DOM. A framework for integrating and manipulating X3D scenes as HTML5/DOM elements.
http://x3dom.org
Other
813 stars 271 forks source link

[Question] - 2D game/simulation #1250

Closed anonimo82 closed 1 year ago

anonimo82 commented 1 year ago

Hello there. I have this question, is it possible to run a 2D physics simulation with X3D? Something I could do with SVG and MatterJS, but I'm told SVG is not suitable for complex games, while it looks like X3D is. So, is it possible?

Thanks for any help.

Regards =)

anonimo82 commented 1 year ago

P.S.: Look here: https://brm.io/matter-js/demo/#svg

andreasplesch commented 1 year ago

X3D has a Rigid Body Physics component: https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rigid_physics.html

It is designed for 3d but could probably be restricted to 2d by keeping physics in one plane.

x3dom has some support for the physics component using ammo:

https://andreasplesch.github.io/Library/Examples/html5/physics/

anonimo82 commented 1 year ago

Yes, I knew that. I was just wondering what you just mentioned, that is, if it's possible to restrict physics to a single plane. So, how can it be done?

Thanks for your help by the way.

@andreasplesch

andreasplesch commented 1 year ago

This is up to the designer. There is no explicit support, eg. something that would enforce that. So it is necessary to carefully define any movement to stay in the plane.

anonimo82 commented 1 year ago

Uhm, is it there any working example/literature available?

anonimo82 commented 1 year ago

By the way, this answers my question, so I'm going to close this

ManishK-mky commented 1 year ago

Yes , becz X3D is a file format and a web standard for 3D graphics and multimedia.