Ballance imitation demo -- using Three.js and Ammo.js

game-dev
open-source
physics
#1

Link to the demo:
http://ballanceonline.com/

This demo uses Ammo.js as physics engine.

Demo source code:

3 Likes

#2

Nice! :grin: That was a lot of fun.

Couple of points:

  1. the controls need a bit of fine tuning, it’s hard to make minor adjustments
  2. the ball often rolls in the wrong direction.

I’ve faced 2. before, it’s hard to get balls to roll correctly. Are you applying the rotations in world or local space?

1 Like

#3

Thank you. Here is the code from Ammo.js

    ms.getWorldTransform(transformAux1);
    var p = transformAux1.getOrigin();
    var q = transformAux1.getRotation();
    objThree.position.set(p.x(), p.y(), p.z());
    objThree.quaternion.set(q.x(), q.y(), q.z(), q.w());

I think it should be in world space.

1 Like

#4

Nice game!

I think @looeee refers to the forces applied to the ball.

0 Likes

#5

Cool!:grin:

0 Likes

#6

Good work! Reminds me of one of my all time favorite games: Snowball run! A penguin running on a snowball on difficult tracks high in the sky. :smiley: (And with the most annoying music.)

0 Likes