A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by drozzel » Thu Mar 17, 2011 4:27 pm
Hi all,
I am currently adapting my robot simulator so that he reacts exactly the same as in the real world with a gravity of -9.81.
I used before the same gravity/conversion factors as in the Mercior demo.
NEWTON_GRAVITY -800.0f
const float NewtonToIrr = 32.0f
So now I changed my code to NEWTON_GRAVITY = -9.81
but I am unsure of the conversion factor.
I did read on the forum that if you have for example a object of 50 units that represent 1m you have to scale down to physics world so 1 unit becomes 1 meter, only then you get a visual realistic fall speed. (robot falls to slow right now)
The shapes I use are in fact in mm so 1 irrlicht unit = 1mm. Does this mean I have to divide all irrlicht coordinates by 1000 when I create the newton bodies/collisions to get a realistic fall speed?
Thx in advance.
-
drozzel
-
- Posts: 6
- Joined: Sat Jun 26, 2010 4:27 pm
by Julio Jerez » Thu Mar 17, 2011 5:22 pm
if you are using irrlicht unit = 1mm.
the you scale fator is
9.8 * m/s * 1000 mm/1m = 9800
I would no use such unit, because there are many contact in teh engien that are calibrates to use MKS system.
so using such small usint system will definitlly troughh off the engine.
what I would do is to use the metric systm in the physics engine and your own sysme for the graphics.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by drozzel » Fri Mar 18, 2011 11:42 am
Not sure if I did understand that.
If the body of my robot is lets say 100mm(real size) long and I import the model into irrlicht it is 100 irrlicht units long.
If I work with those units in newton the object will fall very slow because newton uses the mks. How do I get the gravity right in this case?
-
drozzel
-
- Posts: 6
- Joined: Sat Jun 26, 2010 4:27 pm
by Stucuk » Fri Mar 18, 2011 7:29 pm
Multiply by the difference in units (1000mm = 1meter) when sending any numbers to newton and do the opposite when you get numbers from newton and use them in Irrlicht.
-

Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by drozzel » Mon Mar 21, 2011 4:08 pm
Thx both for the explanation,
I did play a bit with the scalefactor.
If I increased the scalefactor the falltime also increased perfectly so the physics indeed work correct.
It just looks slow because well my robot is huge in newton compared to the real robot(I finally understand the logic behind it now

).
I now used a scalefactor of 100 so basically my robot is still 10 times bigger then in real. Everything works correct, fallspeed is correct for that size.
I also tried with a factor 1000 (real robot size) but then all weird things start to happen, suddenly the joints are not strong enough anymore and I see the legs of the robot sink into the floor very slowly.
So I guess small objects like lets say (height=10cm, length 22cm, width15cm) are better avoided?
-
drozzel
-
- Posts: 6
- Joined: Sat Jun 26, 2010 4:27 pm
by Stucuk » Tue Mar 22, 2011 7:23 pm
Err, think i made a mistake, should be divide not multiply in the first sentence of my post. Goal isn't to make it bigger but to make it have the same value but in meters. So it would be divide not multiply.
-

Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest