Space to hide/show all options. Grab the ball (click and hold while your cursor is over it.) If Advanced Throwing is not on, move the ball wherever you want, and the farther away it is from when you first clicked it, the faster it will go in that direction after letting go. If Advanced Throwing is on, fling it around by moving your cursor quickly and than letting go of the ball. You can set the gravity with the slider. (0.5 is low gravity and 2 is high gravity.) You can set the floor's friction with the slider. (0 is no friction and 2 is basically infinite friction (only when gravity is NOT 0,) but this doesn't account for air resistance, so the x velocity will still decrease over time even if the friction is 0 unless air resistance is off.) If "Air Resistance," "Ceiling," "Energy Loss," "Advanced Throwing," or "Border Friction?" is 1, it is on, if 0, it is off. Ball was/is considered an average Basketball and floor is considered concrete bricks in terms of energy loss calculations. #physics #engine #math #cool #physicsengine #physic-engine #1 #2 #3
Fullscreen recommended (normal view is broken for some reason..?) I made this completely myself. No tutorials. Thanks to @programerseer_tester for the idea of making a physics engine though. His physics engine is https://scratch.mit.edu/projects/1089238068/ ...I actually calculated the energy loss that should happen for each bounce of the ball after it falling for him, and while doing that, I was like, "Why not make my own engine?" In order to calculate though, he had to pick a type of floor and ball. He chose Basketball and concrete, so I did the calculations, and energy loss should be something like this. Ball bounces 0.8 or 0.7 times as high every time. So I guess I am officially GENIUS >:)))) (I had to use an already done experiment for reference though so I am not THAT smart :(. They dropped a Basketball from 1 meter on to different surfaces and let it bounce once. When they dropped it on concrete it lost about 20% energy. And since I already did the calculations for his engine, I decided to do it here as well with the same calculations (Basketball and concrete.)) Btw the "reference" I am talking about is this: https://physics.stackexchange.com/questions/672209/how-to-calculate-energy-loss-from-falling-balls V1: Released. V1.1: Added a slider to change friction. V1.2: Fixed some bugs and polished some stuff. (Wow very specific.) Basically fixed the X and Y velocities being wacky while holding the ball, and changed some of the things that diminished the X and Y velocities to look a bit smoother. Also added thumbnail. V1.3: Added that after X Velocity gets smaller than 0.1 it just sets to 0. I did a similar thing with Y velocity. Also added a ceiling. Also added rotation (the ball now rotates.) V1.4: Added an option to change air resistance. Also added a button to hide/show all options. Added an option to remove the ceiling (still a bit weird, I am going to try to polish this feature later.) V1.5: Added zero gravity. V1.6: Fixed options not hiding when space is pressed. V1.7: Added an option for Advanced Throwing. Advanced Throwing is a work in progress and has some bugs. Also changed the thumbnail a bit. V1.8: Added an options for friction to affect all borders, not just the floor. V1.9: I forgor... V1.10: Bug fixes