Confined collisions with a dose of gravity
August 1, 2008 @ 1:42 pm in Microsoft, Silverlight
Over the past few months I have created a handful of Silverlight 2 examples that demonstrate basic physics. In this example I am going to demonstrate containment of a variable number of spheres with gravity causing deceleration. Below you see a simple Grid which I will place a set number of spheres within. Each sphere will be inserted into the grid at a randomized X position, within the top 20 pixels of the container. Each sphere drop immediately and react to any collision with the container or other spheres elastically.
If you run this a few times you are bound to find it freak out. I am still in the process of tracking down why on a occasion it appears get lost and the spheres disapear.
/p>
Tagged as 

August 11th, 2008 at 3:24 am
Hi Joel and thanks for this interesting demo. I’ve restarted the app with 26 spheres about 30 times now and I haven’t experienced the problems you’ve mentioned. It all works fine for me. I’ve tested it on WinXP, both FireFox 2 and IE7
August 12th, 2008 at 2:56 pm
[...] Silverlight Video Player he and Tim Heuer put on CodePlex… and he makes this all look simple :) Confined collisions with a dose of gravity Joel also has this post on confined collisions … I saw this just before heading out on vacation, [...]
August 26th, 2008 at 11:25 am
Very cool stuff Joel!
Too bad you didn’t use the farseer silverlight physhics engine though, it would have probably cut down the time needed to build this example.