I'm writing a program that needs to be able to simulate a system of elastic bodies, that can collide with each other and with other rigid bodies, and deform accordingly. I think it would be an instructive exercise to write the code myself, rather than copy an existing physics engine, so I want to start by learning a little bit about how elastic bodies behave at a molecular level.

I was thinking about building my virtual elastic bodies as systems of "nodes", each with a certain mass, interconnected by springs. But I have no idea if that resembles the way molecules in a semisolid interact with each other.

Can anybody recommend a book or other resource, or at least a subject to get started probing into? Bear in mind that my program doesn't need to be highly accurate, and the extent of my physics knowledge is basically a fuzzy memory from high school.

  • $\begingroup$ I think the term 'elastic bodies' is confusing here because when one talks about an 'elastic collision' they usually refer to a collision between rigid bodies. What you're trying to do would be more accurately classified as a soft body simulation. $\endgroup$
    – zzz
    Apr 2 '15 at 3:09

I was thinking about building my virtual elastic bodies as systems of "nodes", each with a certain mass, interconnected by springs.

You just described Finite Element Modeling - the cornerstone of mechanical engineering, and the method used for making sure that that bridge won't collapse when an 18 wheeler passes over it.

This is an extremely well researched / published branch, and there is an enormous amount of material available. Most people use existing engines to get their results - it sounds to me like you want the fun and challenge of writing your own. That's laudable; I would strongly suggest to start in 2D, and use triangles to divide your solid objects into nodes.

I found an article that purports to be a how-to guide for writing your own code - but it is only available on subscription. However, there's another more recent paper that describes how to use the SfePy library to create your own finite element models in 2D or 3D.

That might be a good place to start. Doing this entirely from scratch may turn out to be frustrating; the Python route should give you a nice introduction, and you can then decide if you want to go deeper.

These kinds of things quickly eat up an enormous amount of compute power, and will be quite slow. Gaming engines take shortcuts - but it sounds like you want to do this properly. Hat off to you, and good luck!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.