RaananW

Heightmap with the physics engine

Recommended Posts

Hi guys,

coming soon to the babylon.js near you - height maps using cannon.js! :D

The image attached shows a prototype of the heightmap integration. There are a few problems to be solved, but 2.3 will have an impostor for heightmap (for now for cannon.js only).

post-10310-0-76467500-1445705376_thumb.p

Share this post


Link to post
Share on other sites

Roller coaster time!  Just one tiny applyImpulse, and the coaster goes for 3 weeks without re-impulse!  WOW! 

 

How many shades of gray are there?  :)  That's how many steps the Slinky/sphere will need to traverse.

 

Actually, I just want to put some marbles in a bowl, for now.

 

Any surface is a (potentially physics-active) heightMap (soon), eh?  Wow.  That's a huge huge statement, Raanan!

 

The insides of tubes, too?  Too fun!

 

Thanks for your work on this, R!  Well done! 

Share this post


Link to post
Share on other sites

Both are coming this evening. I'm waiting for the new version and the new cannon to be deployed.

@wingnut - I'm already experimenting with other kinds of structures. But a height map impostor will only fit open objects (a bowl is a good example, or any open surface). The second limitation is that the physics will only be enabled for the upper part of the mesh. below the results are unexpected. I'm still working on making it as easy as possible for the developer and will then commit the changes.

Share this post


Link to post
Share on other sites

Demo time!

http://www.babylonjs-playground.com/#EXL6K

a mouse click will throw the balls in a random direction.

 

I will create a better one once I fix the little bug (which is fixed with line 48). Once this is fixed (Shouldn't be long, I know exactly what the problem is) It is ready to be used :-)

Share this post


Link to post
Share on other sites

Yei! fun with heightmaps!

http://www.babylonjs-playground.com/#D3LQD

the latest update allows you to use any flat and square surface as a height map. the ribbon in this PG is a wonderful example. A mouse click will release spheres and boxes for your viewing pleasure.

if you have any questions, please let me know.

 

As you can see, rotation etc' can be applied on the meshes, and update physics body position works as well.

Share this post


Link to post
Share on other sites

It seems that when the spheres and box on the ribbon, the FPS is 30 FPS in average and it is on the map everything is 60 FPS. It's strange I should think otherwise, the forms of the card are more complex than the ribbon.

Share this post


Link to post
Share on other sites

Yes, it is perfect demo. between 50 and 60 FPS.

Raanan thank you for this excellent feature. Do you reproduce the same for OimoJS? this engine was more efficient in comparison tests.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.