Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat would be "realistic" values for gravity, mass and contact material in cannon.js?
    primarykey
    data
    text
    <p>i've looked in the cannon.js examples, and they seem to mostly use between -10 and -40 for gravity and something between 1 and 10 for the mass of an object (or CANNON.RigidBody as they are called), these demo objects are "well behaved" with these values in that they are just "heavy" enough to overcome gravity and not so "heavy" that they make the ground plane look fake.. by that i mean that i have tried increasing the masses of falling objects and the more mass they have the more they make the floor look like it is made of marshmallow (i.e. spongy) when they land. (btw: <em>yes, i do know that mass and weight are not the same thing</em> ;-)</p> <p>gravity is usually 9.8 m/s/s in mathematics so how could that be implemented in CANNON.World.gravity ?</p> <p>i have found on the internet that the mass of stone is 2515 kilograms/cubic metre, so if i wanted to drop a 1x1x1 metre stone block how would that translate into mass for:</p> <pre><code>var block = new CANNON.RigidBody(mass, shape, material); </code></pre> <p>and then there is this <code>material</code> parameter.. would i need to have 2 materials (1 for the floor and 1 for the stone block) and then how would i set the friction coefficient and restitution values for the materials to react when they collide?</p> <p>i know this seems like many questions, and i'm not aiming for absolute accuracy, just needing guidance because of a) my lack of knowledge with physics and b) not much documentation for those of us trying to use cannon.js who are not physics professors ;-)</p> <p>the real question is "How to approximate realism" i guess.</p> <p>cannon.js is great, works really well, and i really appreciate all the hard work that Stefan Hedman (<a href="https://github.com/schteppe" rel="nofollow">schteppe</a>) has put into it so far.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload