|
Recently I have written an introductory tutorial on how to program your own soft body simulations in real-time environments. Here are some of the things that you will be able to create by the end of the tutorial:
This article won three prizes:
Downloads: PDF tutorial file (913.1 kB) | Source codes (639.7 kB) or get the files from my XNA – Skeel Soft Body Physics GitHub repository Please consider tipping me for my open source efforts
NOTE: It assumes that you are an absolute beginner in physics simulation programming, but it does assume that you know about object-oriented programming. The tutorial uses XNA 3.0, which is the framework used for creating games on the PC, Xbox 360 and the Zune (Microsoft’s MP3 player). The language used is C#. Hope you like the article! |
Copyright © 2003-2024 Skeel Lee. All works are original ones by Skeel, unless otherwise stated.
|
How can I implement “Self Collision”?
Generally speaking, you will need to detect vertex-triangle collisions i.e. detect if any vertices are going through triangles on the cloth mesh. If they are, you will need to move them out via constraints or by applying a repulsive force.
This is beyond the scope of the tutorial. I might have a go at writing a collision detection tutorial in the future
BTW, this is a great tutorial, and I’ve implemented a GPU version of this tutorial, and it works beautifully!!!
Excellent!
Wow, this tutorial is incredible! I can’t believe it’s (from what I’ve seen) rarely talked about.
I was able to convert about half or so of this to 2D (spring/chain simulation), cloth wasn’t possible for obvious drawing reasons.
So thank you, I’m now more interested in physics than I’ve ever been.
Glad that it helped!