Chris Cavanagh has posted some great code on using a physics engine with WPF. It's an interesting and elegant example demonstrating a few things:

  • A series of objects making use the wrapped physics engine Chris has chosen.
  • The use of data templates and binding to represent the objects on screen and the use of matrix transforms for rendering based on updates from the the physics code.
  • The interception of the CompositionTarget.Rendering event to perform the physics updates (which results in UI updates owing to the binding)

Take a look at a screen shot:

Extremely smart, and the first example I've seen of such stuff. So who's building the 'Asteroids' clone?

 

Technorati Tags: -