DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Physijs - A Physics Plugin For Three.js

Physijs - A Physics Plugin For Three.js

Hirvesh Munogee user avatar by
Hirvesh Munogee
·
May. 01, 12 · Web Dev Zone · Interview
Like (0)
Save
Tweet
6.97K Views

Join the DZone community and get the full member experience.

Join For Free
physijs brings a very easy to use interface to the three.js framework. one of the reasons three.js is so popular is because it is so incredibly easy for graphics newbies to get into 3d programming. physijs takes that philosophy to heart and makes physics simulations just as easy to run. in fact, there are just five easy steps that must be taken to make a 3d scene come alive.

how does physijs work?

physijs is built on top of ammo.js (although there is also a cannon.js branch) and runs the physics simulation in a separate thread (via web worker) to avoid impacting in your application's performance and taking up your your 3d rendering time.

a lot of effort has been made to keep the style of code the same when using physijs. apart from updating an object's position, all of the normal three.js conventions remain the same. if you are used to three.js, you already know how to use the physijs plugin.

who is this for?

you, hopefully. if you are familiar with three.js and want to add physics to your scene, this is the plugin for you. no mucking about with shape definitions, keeping objects in their correct positions, or identifying collisions - simply use a few physijs objects in place of three.js's and you'll automatically have a dynamic environment.

if you need (or want) a feature not already included then add it to the issue tracker or implement it yourself and send over a pull request.

features

  • support for multiple object shapes, including custom convex objects.
  • material system provides simple control over friction and restitution ("bounciness")
  • integrated collision detection and events
  • compound objects using the hierarchy system in three.js
  • rotations using either euler or quaternion systems - your preference
  • built seamlessly on top of three.js to keep the same convention and coding style


requirements : d3.js
demo : http:/ / chandlerprall. github. com/ physijs/ examples/ body. html
license : mit license
Object (computer science) MIT License Collision detection Collision (computer science) application GitHub Requests

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Password Authentication. How to Correctly Do It.
  • The Most Popular Technologies for Java Microservices Right Now
  • Simulators vs. Emulators: What's the Difference
  • How to Perform Visual Regression Testing Using Cypress

Comments

Web Dev Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo