News for hackers. Stuff that matters.
Re:Annotated code: Circles bouncing off lines by wingerlang on Sunday February 08, 2015 @10:18PM (#9019586)
Reminds me of a simple physics system I wrote a couple of years ago [0]. After writing a cloth simulation [1] I figured that all I needed to make them into collidable boxes was to have each dot collide with each line. I went in very very small steps, iterating each thing to ensure I understood it. The code was super verbose and I learned a lot from this about linear algebra, cross products, vector projection etc. I always planned to straighten the code out and do a proper writeup.

[0] https://www.youtube.com/watch?v=ud8NirjyLAA

[1] https://www.youtube.com/watch?v=G05M_Y6NQVM

Re:Annotated code: Circles bouncing off lines by thisjepisje on Monday February 09, 2015 @06:55AM (#9020707)
The tearing is awesome, haven't seen that before in cloth simulations.
Re:Annotated code: Circles bouncing off lines by wingerlang on Monday February 09, 2015 @08:45AM (#9021085)
Thanks. If you find it enjoyable to watch I'd recommend you to do a youtube search because there's actually a lot of it.

As for the implementation, it is extremely simple. For anyone interested just do a search for "verlet cloth".

EDIT: I'd specifically recommend this one [0]. It looks quite simpler than many on youtube but it feels more real.

[0] http://web.media.mit.edu/~bandy/cloth/