Simulating Simple Rigid Body Physics, Few Bounces
Blitz3D Forums/Blitz3D Programming/Simulating Simple Rigid Body Physics, Few Bounces
| ||
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. |
| ||
search for "reflection vector" "billard physics" "marble physics", there are a few examples in the forums/codearchives |
| ||
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. |
| ||
"reflection vector" is what you are looking for. an old example by Bobysait : |
| ||
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. |
| ||
another example with basic physics : http://www.blitzbasic.com/codearcs/codearcs.php?code=2029 |
| ||
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 ...) |
| ||
Thanks RemiD and awesome demo Bobysait! definitely looks up to date :) |
| ||
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. |
| ||
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 |