Following on from my experiments the other day with geometry-based collision detection I’ve been looking at good old vectors. I set myself two tasks
- Work out how to reflect angles
- Work out how to make a ball bounce off arbitary angled surfaces
It took a few hours of confusion, debugging and asking questions on the Internet and doing a bit of research but I’ve managed to create a nice little Processing applet that lets the user draw lines on the screen and have a ball bounce off them. To someone whos’ grasp of maths isn’t that great, it was fairly straight forward. Calculating 2D surface normals is surprisingly easy. Again I drew things on graph paper to help my understanding.
Click here to play with my balls!

