Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Chat / Does 3D physics work on super small scale?

Author
Message
basicFanatic
1
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 29th Dec 2017 01:26
I'm toying with the idea of creating a mobile ball game at 1:1 scale. Kind of like this one:
http://tintoys.com/wp-content/uploads/2014/03/SRPBm.jpg

But are the physics able to deal with such small dimensions?
Markus
Valued Member
14
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Dec 2017 01:42
here is some info about this Bullet Physics
https://www.appgamekit.com/documentation/Reference/3DPhysics/Create3DPhysicsWorld.htm
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
blink0k
AGK Developer
5
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Dec 2017 02:07
I have found that physics on a small scale causes tunneling
Scraggle
VIP Member
15
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Dec 2017 07:49
Why do you need it to be 'super small'?
Just because the game you are simulating is a small hand-held device doesn't mean that the physics code has to be so small.
The ball, for example, could have a 1 metre radius and the rest of the device sized accordingly. Alternatively the ball could have a 1mm radius and again, scale the rest of the game accordingly. Once it's on screen you won't have any way of knowing the scale of the physics world.
So, don't worry about trying to replicate the real world on a 1:1 scale. Just make it work and once it's on a mobile phone it will be about the real world size anyway regardless of the size of the physics world.
Green7
12
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 29th Dec 2017 07:55 Edited at: 29th Dec 2017 07:56
Why do you want to make it at a 1:1 scale? i mean, you could scale it up by 10, and it stays the same, but physics work better.

Edit: Scraggle, why u so fast!?
basicFanatic
1
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 29th Dec 2017 09:19
That's one thing I have wanted to know for a while: does the laws of physics work the same, regardless of scale? For one thing, that gravity attraction thing doesn't kick in unless they object are the size of planets. And insects can survive falling from great hights. (I started thinking about this stuff when playing around with Algodoo)

Guess scale factor would mean something, but I have a bit of trouble wrapping my head around why the height of a person would alter the laws of physics?
Markus
Valued Member
14
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Dec 2017 12:02
Quote: "The ball, for example, could have a 1 metre radius and the rest of the device sized accordingly. Alternatively the ball could have a 1mm radius and again,"


its not the same physics but bullet physics support a scale mode.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
BatVink
Moderator
15
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Dec 2017 15:40
It's less about the physics of motion (which can be fiddled) and more about the size of objects.
It's easier to detect a collision with a 1metre sphere than it is is to detect collision with a 1mm (0.000976563 m) sphere. as you can see, you have lost accuracy at the millimetre level.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
14
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Dec 2017 23:01 Edited at: 29th Dec 2017 23:01
Quote: "It's easier to detect a collision with a 1metre sphere than it is is to detect collision with a 1mm (0.000976563 m) sphere."

but 1 meter sphere have a different mass, and speed, also the gravity is not the same.
what u mean is 1mm = 10 physic unit or 100 physic units.
Quote: "detect a collision"

for 3d the docu said only "The Bullet Physics solver has a minuim size for objects."
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2017 18:43 Edited at: 30th Dec 2017 20:20
I think you are all misunderstanding what the scale factor is in Bullet Physics.

Quote: "
You must create the the Physics world before calling any other physics commands. Create3DPhysicsWorld Creates the physics world using the default scale factor of 40. This function will create the physics world with a different scale factor. The scale is not the size of the world, it is the factor by which all the data passed in is scaled down by to convert it to the Bullet Physics scale for the physics calculations. Then the data from Bullet is scaled up before it is passed to the AppGameKit 3D world. The default scale factor will be correct if your average character size is 72 AppGameKit units tall. Then the default gravity of -10.0 meters per second on the Y axis will give the correct visual result. The Bullet Physics solver has a minuim size for objects. Objects below this size will cause instability with the solver. At the default scale factor of 40 the smallest dimension that the solver can handle is about 3.5 AppGameKit units. To calculate the scale factor first determine your character's height in meters, a character of 72 units tall would be 1.8288 meters (or 6ft). Then divide the character's height in units by the characters height in meters, for this example the scale factor would be (72 / 1.8) = 40. "
The coffee is lovely dark and deep,and I have code to write before I sleep.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 30th Dec 2017 20:09
From the info, for physics to work properly the scale needs to be 1unit = 40units.
So everything *40 should work. E.g. as mentioned:
player_height= 1.8 * 40= 72
Markus
Valued Member
14
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Dec 2017 22:30
i understand
1mm / 1000 = 0.001 meter * 40 is 0.04 and smaller than 3.5 units so the solver did not work with default scale 40.


AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 2nd Jan 2018 10:01 Edited at: 2nd Jan 2018 10:14
The odd scale of 40 perhaps has something to do with inches? (as was created in USA: https://en.wikipedia.org/wiki/Bullet_(software) )
For 1m = 39,3701 inches, rounded to scale 40 for ease of use.

Real world 1.85m average male height rounded to 1.8 * 40 = 72 meter units for the Bullet physics resolver that works in inches?

Or am I off here?
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 2nd Jan 2018 14:15 Edited at: 2nd Jan 2018 14:20
Please read this link.
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Scaling_The_World

When I originally started using Bullet physics in my DBPro plugin DLL I had to deal with scale because the average size of objects
that were used by DBPro users( including me) was not with in the range of the Bullet physics solver.

Quoting the Bullet Documentation from the link above.
Quote: "By default, Bullet assumes units to be in meters and time in seconds. Moving objects are assumed to be in the range of 0.05 units, about the size of a pebble, to 10, the size of a truck. The simulation steps in fraction of seconds (1/60 sec or 60 hertz), and gravity in meters per square second (9.8 m/s^2). "


So if we want to use the default gravity of -10.0 m/s^2(Rounded) on the Y axis, an object say for example a FPSC character of 72 DBPro
units tall will not fall at a correct visual rate on screen because it's size is outside the Bullet physics solver range.
So I needed to calculate a scale factor to scale the objects size by to keep it with in the Bullet physics range.
As stated in the Bullet physics documentation: By default, Bullet assumes units to be in meters and time in seconds.
Moving objects are assumed to be in the range of 0.05 units, about the size of a pebble, to 10, the size of a truck. So 1.8 meters the average
size of a person times 40(scale factor) = 72 DBPro units. In my DBPro DLL I used the 40 scale factor to scale down the size of the DBPro objects
then pass that size to the Bullet physics engine. When Bullet gives me back the new position of the object I scale it back up to give the correct
position on screen for the best visual results. When I added Bullet to AppGameKit the character I was given to use for the demos was a FPSC masked
soldier which was also 72 AppGameKit units tall. So the 40 scale factor was still a good default scale at the default gravity. The AppGameKit user has the ability to
change the gravity and the scale factor to what ever works best for their projects. If you do not want to use the scale factor just set it to 1.
Then just keep the size of your objects with in the Bullet solver range.

In conclusion 40 is not an odd scale nor does it have anything to do what country it was created in.
FYI in the United States all scientific calculations(physics) are done using the metric system.
All the other physics engine solvers also work this way.
Hope this helps clarify the subject.

The coffee is lovely dark and deep,and I have code to write before I sleep.
Green7
12
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 4th Jan 2018 08:18
Thanks Stab for this explanations!
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 4th Jan 2018 09:06 Edited at: 4th Jan 2018 09:11
Indeed thanks again Stab.

Interestingly enough, when investigating Bullet Physics on AppGameKit I found the software for usage in Python and C++) is freely available on GitHub ( https://github.com/bulletphysics/bullet3/releases ) and is apparently created by a Dutch guy now working for the Google Brainteam which is/was also closely tied to Boston Dynamics. You know: from our lovely, friendly, little backflipping dude, 'Atlas The Robot' (soon to be a real life Terminator )
They apparently using/used this to train the robot:


Perhaps it's partially due to Bullet physics that it can now make backflips..
Carharttguy
2
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 4th Jan 2018 20:08 Edited at: 4th Jan 2018 20:09
Quote: "That's one thing I have wanted to know for a while: does the laws of physics work the same, regardless of scale? For one thing, that gravity attraction thing doesn't kick in unless they object are the size of planets. And insects can survive falling from great hights. (I started thinking about this stuff when playing around with Algodoo)"


But what makes you think gravity attraction doesn't work on small object? Because this is not true. 2 marbles on your table attract eachother with the same force as planet earth and the sun attract eachother. (Ofcourse relative to their weight)
If you jump, you push the earth away with the same force as you are forced away from. earth. (Again, relative to their weights)

Insects survive falling because their max speed downwards is WAY lower than humans because they are much lighter. NOT because physics don't affect them.
Conjured Entertainment
AGK Developer
13
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 4th Jan 2018 21:40
Right, but virtual reality and reality are not the same.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Stab in the Dark software
Valued Member
15
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 5th Jan 2018 15:47
Quote: "Insects survive falling because their max speed downwards is WAY lower than humans because they are much lighter. NOT because physics don't affect them."


Correction, all objects fall at the same rate regardless of weight.
The astronaut David Scott demonstrated it on the moon.

https://nssdc.gsfc.nasa.gov/planetary/lunar/apollo_15_feather_drop.html
The coffee is lovely dark and deep,and I have code to write before I sleep.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 6th Jan 2018 00:13 Edited at: 6th Jan 2018 00:15
Afaik, higher mass is higher gravitational pull, but the falling speed acceleration is always the same in a vacuum, for a feather the same as for a cannonball or a planet sized object (from what I was always told).

But because of the distance and higher pull(effective over longer distance) the speed would increase more.
On earth insects experience air resistance which slows them down relative to their size as a parachute would slow down a larger object. Therefore there is a maximum velocity due to air resistance also called terminal velocity.

(Please correct me if I'm wrong, been a long time since had to deal with this).

Login to post a reply

Server time is: 2018-10-15 21:57:06
Your offset time is: 2018-10-15 21:57:06