How to handle REALLY small bodies?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

How to handle REALLY small bodies?

Postby pablonewton » Tue Mar 10, 2009 5:26 pm

Hi, I need to know how to handle really small bodies with Newton. This is because in order to manipulate objects with the haptic device I'm using the units of every object must be REALLY small.
I ask this because I did one example where I have a teapot having a convexhull or a NewtonBox as its NewtonBody and a box shaped floor with a collisiontree or a NewtonBox with mass = 0. When I start the application the teapot is placed a little above the floor and it falls on it, but starts to bounce and move, and in the end it falls through the floor. I think this is because of the dimensions of the bodies that are too small, having dimensions of their bounding boxes like these for example:

Teapot : widht_x: 0.014333, height_y: 0.011242, depth_z: 0.022942
Floor: widht_x: 0.155701, height_y: 0.017946, depth_z: 0.088241

1) So, Is there a way to tell Newton that the units used are really small in order to avoid this tunneling problem?

2) I also I noted that the teapot falls really quick, but if I scale these dimensions to make them bigger, the teapot falls a lot more slowly.
Do I have to scale the values of the forces and masses for every object so they don't move so fast? (I set the gravity = mass*9.8)

3) I also set this:
NewtonSetMinimumFrameRate( newton.GetNewtonWorld(), 300 );
in order to have more accurate collision detection, is that correct?

I gave both bodies a wooID material like the tutorials.

Thanks in advance.
pablonewton
 
Posts: 4
Joined: Mon Apr 23, 2007 12:04 pm
Location: Concepción, Chile

Re: How to handle REALLY small bodies?

Postby Stucuk » Tue Mar 10, 2009 6:46 pm

If your entire world is rearly small, then you can have the physics scalled up as if it was a larger world and then scale down the positions/whatever when needed(i.e rendering).
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: How to handle REALLY small bodies?

Postby JernejL » Tue Mar 10, 2009 7:21 pm

You can try using the double precision library if that helps.. but i really suggest for single precision that you use object sizes that best use range from 0.01 to 4096 (also -4096), usual set-ups are 1 unit = 1 meter, the floating point imprecision is simply not workaround-able in any other way, also try to avoid having ridiclously huge and ridiclously small objects interacting..
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: How to handle REALLY small bodies?

Postby pablonewton » Thu Mar 12, 2009 9:42 am

Delfi wrote:You can try using the double precision library if that helps.. but i really suggest for single precision that you use object sizes that best use range from 0.01 to 4096 (also -4096), usual set-ups are 1 unit = 1 meter, the floating point imprecision is simply not workaround-able in any other way, also try to avoid having ridiclously huge and ridiclously small objects interacting..


Thanks Delfi, but with regards to the double precision library:

a) Does it fix the tunneling problem I mentioned?
b) Can I use smaller values with this library (in Newton) than 0.01?
c) How does this library can be used wih Newton?
d)...Where can I get it? :oops:

Thanks again.
pablonewton
 
Posts: 4
Joined: Mon Apr 23, 2007 12:04 pm
Location: Concepción, Chile

Re: How to handle REALLY small bodies?

Postby JernejL » Thu Mar 12, 2009 1:40 pm

pablonewton wrote:
Delfi wrote:You can try using the double precision library if that helps.. but i really suggest for single precision that you use object sizes that best use range from 0.01 to 4096 (also -4096), usual set-ups are 1 unit = 1 meter, the floating point imprecision is simply not workaround-able in any other way, also try to avoid having ridiclously huge and ridiclously small objects interacting..


Thanks Delfi, but with regards to the double precision library:

a) Does it fix the tunneling problem I mentioned?
b) Can I use smaller values with this library (in Newton) than 0.01?
c) How does this library can be used wih Newton?
d)...Where can I get it? :oops:

Thanks again.


A: use continous collision
B: i haven't tested, but seriously you should scale up your sistem
c: what?
d: get it here, double precision libraries are included. viewtopic.php?f=9&t=4922
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron