Sporbie
03-27-2008, 10:11 PM
So I made this little physics toy with Processing (it's a Java based graphics engine, very easy to learn).
It's very very basic ball physics, the balls don't even collide because I'm not very good with trigonometry.
But this is all my code, I used no premade physics engine, well of course except for drawing things on screen.
There are a few buttons in the toy that change gravity, air resistance, and friction. Sometimes the values go all weird, I don't know why this happens, probably a glitch in the language itself.
There are also some mouse and keyboard controls:
Left click- spawn a random sized ball
Right click and drag - spawn a new ball and manually set the direction and force of the ball
'T' - ball trails
'A' - toggle antialiasing
'R' - Erase all balls
'S' - apply random forces to all balls
http://www.speedyshare.com/769997650.html
I've included the mac, linux and windows version with the source code in the rar file.
Also can anyone of you leet fizx programers show me how to add ball to ball collision, I saw the code that does it, but I don't understand it so can anyone show me?
It's very very basic ball physics, the balls don't even collide because I'm not very good with trigonometry.
But this is all my code, I used no premade physics engine, well of course except for drawing things on screen.
There are a few buttons in the toy that change gravity, air resistance, and friction. Sometimes the values go all weird, I don't know why this happens, probably a glitch in the language itself.
There are also some mouse and keyboard controls:
Left click- spawn a random sized ball
Right click and drag - spawn a new ball and manually set the direction and force of the ball
'T' - ball trails
'A' - toggle antialiasing
'R' - Erase all balls
'S' - apply random forces to all balls
http://www.speedyshare.com/769997650.html
I've included the mac, linux and windows version with the source code in the rar file.
Also can anyone of you leet fizx programers show me how to add ball to ball collision, I saw the code that does it, but I don't understand it so can anyone show me?