Three.js x Physi.js

Standard

Fun with Three.js and Physi.js

While previously we’ve seen how easy it is to create a 3D scene using Three.js. Here, we try to combine Three.js with a physics engine. Physi.js is a javascript physics engine, built on top of ammo.js, which in turn is a port of the well known Bullet physics engine.

Since it’s deeply integrated to Three.js, creation of the physics objects are fairly straightforward. Here’s an example that I whipped out in a short time.

You can get my sample codes here: https://github.com/subokita/WebGL-Sandbox/tree/master/Test%20%23003%20-%20Physjs

Please note that you cannot run the example locally as is, due to browser ‘same origin policy’ security check. Please refer to https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally in order to run the example locally.

[1] Physi.js is available here: https://github.com/chandlerprall/Physijs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s