Simulating Simple Rigid Body Physics, Few Bounces

Blitz3D Forums/Blitz3D Programming/Simulating Simple Rigid Body Physics, Few Bounces

RustyKristi(Posted 2016) [#1]
I saw old examples but still looking for some basic ones like a box that bounces a bit then just sit stationary.

I can't use 3rd party libs here just avoiding to mix physics engine and b3d collisions already in place.


RemiD(Posted 2016) [#2]
search for "reflection vector" "billard physics" "marble physics", there are a few examples in the forums/codearchives


RustyKristi(Posted 2016) [#3]
Thanks RemiD. I found one though I need something simple just can detect and bounce walls and a few on the ground. probably like cannonball physics with a very few bounces.


RemiD(Posted 2016) [#4]
"reflection vector" is what you are looking for.

an old example by Bobysait :



RustyKristi(Posted 2016) [#5]
Awesome! This is just what I need :D so simulating force, momentum or whatever, how do I make it stop? Like throwing a rock normally or off the wall.

Examples like this should be in the code archives, good one.


RemiD(Posted 2016) [#6]
another example with basic physics :
http://www.blitzbasic.com/codearcs/codearcs.php?code=2029


Bobysait(Posted 2016) [#7]
That's a very old sample from Blitz3DFr, Isn't it ?

Maybe a small update could be fine (so here it is)

it contains a small vector library and the "body" for a rigidbody library
(the rigid box is not implemented yet, but I think it could be composed from 8 small spheres, and updated with a verlet stuff, so it could implement torque and stuff ...)




RustyKristi(Posted 2016) [#8]
Thanks RemiD and awesome demo Bobysait! definitely looks up to date :)


RustyKristi(Posted 2016) [#9]
I was thinking more of a simple throwing a single object example and do not infinitely bounce but can bounce through walls. Maybe you can simplify it?

I already found a cannonball physics but it does not bounce and not through walls. Yes the rigid body like box is what I'm looking for.


Bobysait(Posted 2016) [#10]
I've not yet implemented neither boxes nor torque (nor contraints), but the "Sphere engine" is a bit more complete
-> Right Click to launch a ball from the camera
-> F1 to switch Wireframe (useless ... but here it is)
-> F2 to switch the scene (cube/sphere)
-> Space to randomize force for the last ball