# Looking for a 3D physics engine

**URL:** <https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156>\
**Category:** Ruby\
**Created:** [May 25, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156 "2010-05-25T18:32:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingkadelfek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@kingkadelfek](https://www.ruby-forum.com/u/kingkadelfek)\
**Post date:** [May 25, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156/1 "2010-05-25T18:32:04Z")

</div>

Chipmunk seems to be a pretty cool 2D physics engine, but does a 3D  
physics engine exist for Ruby ?

I would like to develop an Alundra-like game :

[![](https://img.youtube.com/vi/-SuAHsje2SY/hqdefault.jpg "Alundra Speed Run - 04(Part 1 of 2)") ](https://www.youtube.com/watch?v=-SuAHsje2SY)

I developed a very simple 3D physics engine by myself some years ago,  
but I lacked the mathematics competencies.  
Here’s a poor sample of what I have done :

> **[Factory 13 enigme plateformes - Vidéo Dailymotion](https://www.dailymotion.com/video/x74186)**
>
> Un test de map avec des plateformes bougeant dans toutes les directions. Le but est d'activer une première plateforme pour attindre le second interrupteur. Puis de faire disparaître la plateforme soutenant le coffre, pour que celui-ci arrive...

Maybe it could help : I don’t need rotations.  
When the player kicks a box, the box slides on the ground and can go  
down a slope, but it never overturns.

If there are no 3D physics engine, I will try to create a basic one from  
a 2D engine, such as Chipmunk.

–

So :

1- does a (simple) 3D physics engine exist for Ruby ?  
2- if no 3D engine exists, which 2D engine do you recommend me to make  
what I want ?

Thank you for your answer.

(I’m french, sorry for my mistakes.)

---

<div class="post-metadata">

**Author:** ![kingkadelfek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@kingkadelfek](https://www.ruby-forum.com/u/kingkadelfek)\
**Post date:** [May 25, 2010, 8:33pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156/2 "2010-05-25T20:33:33Z")

</div>

JRME is a JRuby-based wrapper around JMonkeyEngine and JMEPhysics  
(which use ODE physics engine underneath).

[http://kenai.com/projects/jrme](http://kenai.com/projects/jrme)

I mostly have been playing with this as a basis for nice demo-candy  
for JRuby, but in actuality it is pretty simple to write stuff. If  
you clone this then you can do:

./bin/sample madness (You must have jruby installed and in your path)

…to see a simple game I wrote with it (source is  
./samples/madness\*). There are some other samples there as well.  
jmephysics\_lesson{n} are a basic transcription with some rubification  
of the same tutorials for jmephysics. These should give a good idea  
of how the physics stuff works.

-Tom

On Tue, May 25, 2010 at 11:32 AM, Marc-antoine Kruzik

---

<div class="post-metadata">

**Author:** ![kingkadelfek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@kingkadelfek](https://www.ruby-forum.com/u/kingkadelfek)\
**Post date:** [May 25, 2010, 7:00pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156/3 "2010-05-25T19:00:27Z")

</div>

AFAIK no 3D physics engine has fully fleshed out bindings into Ruby. I  
would highly recommend you look at existing free engines (like Bullet,  
Newton / PhysX, and ODE) and look into building a Ruby wrapper for them  
much more than building one yourself.

I’ve had long-term plans of building such a wrapper. If you do start  
into this I’d love to follow your progress / help out with this.

Jason

---

<div class="post-metadata">

**Author:** ![kingkadelfek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@kingkadelfek](https://www.ruby-forum.com/u/kingkadelfek)\
**Post date:** [May 27, 2010, 2:55pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156/4 "2010-05-27T14:55:52Z")

</div>

Bosko I. wrote:

> Take a look at root.cern.ch. I think they have Ruby support but I’m  
> not sure whether it will suite you.

Are you sure I can use this as a 3D physics engine for my game ? I’s a  
data analysis framework. Or maybe I misunderstood the purpose of this  
soft.

* * *

Jason R. wrote:

> AFAIK no 3D physics engine has fully fleshed out bindings into Ruby. I  
> would highly recommend you look at existing free engines (like Bullet,  
> Newton / PhysX, and ODE) and look into building a Ruby wrapper for them  
> much more than building one yourself.

Create a wrapper is really not something I use to. I looked at a bit,  
but it’s not my cup of tea.

> I’ve had long-term plans of building such a wrapper. If you do start  
> into this I’d love to follow your progress / help out with this.

Thank you for your help, but I have to decline.

* * *

Thomas E Enebo wrote:

> JRME is a JRuby-based wrapper around JMonkeyEngine and JMEPhysics  
> (which use ODE physics engine underneath).
> 
> [http://kenai.com/projects/jrme](http://kenai.com/projects/jrme)
> 
> […]  
> These should give a good idea  
> of how the physics stuff works.

My first attempt to create a 3D physics engine was just a modified 2D  
engine. Because I don’t need rotations, I think I can fulfill by myself  
what I’m looking for.

I will not try to create a “real” 3D engine, rather something pretty  
simple. I looked at your code, and I’m looking at Chipmunk’s code to see  
how things (shape, body, vector) are working.

The actual version of my code is working, but there is a lot of work to  
do.

---

<div class="post-metadata">

**Author:** ![kingkadelfek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@kingkadelfek](https://www.ruby-forum.com/u/kingkadelfek)\
**Post date:** [May 25, 2010, 9:25pm UTC](https://www.ruby-forum.com/t/looking-for-a-3d-physics-engine/189156/5 "2010-05-25T21:25:39Z")

</div>

On May 25, 6:32 pm, Marc-antoine Kruzik [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When the player kicks a box, the box slides on the ground and can go  
> 2- if no 3D engine exists, which 2D engine do you recommend me to make  
> what I want ?
> 
> Thank you for your answer.
> 
> ## (I’m french, sorry for my mistakes.)
> 
> Posted viahttp://www.ruby-forum.com/.

Take a look at root.cern.ch. I think they have Ruby support but I’m  
not sure whether it will suite you.
