Introduction to particle system modeling

Although a precise definition of a particle system probably does not exist, it helps to explain what we have in mind before we do anything else. In the sense in which we use the term, a particle system consists of the following ingredients:

  • A group of particles
  • Rules by which they move and change
  • Rules by which they interact (if any)

This definition is very general: the said “rules” could be based on physics, artificial intelligence, biology, or anything else. It won't come as a surprise that we'll limit ourselves to particles moving and interacting under physical laws (with perhaps the odd tweak here and there). Therefore, the particle systems we'll consider will animate particles according to Newton's laws of motion under the action of a subset of the forces that we discussed in Part II of the book. The different categories of interaction between the particles can include the following:

  • No mutual interaction: In this case, the particles are unaware of each other and move independently under the action of globally prescribed forces (such as external gravity). Even though this is the simplest case, quite impressive effects can be generated using non-interacting particles. We will look at several examples in the next two sections.
  • Interaction by collision: Here the particles do not interact except very briefly when they collide. The collisions can be resolved using the methods given in Chapter 11. In fact, the last example in Chapter 11 showed just such a system of particles interacting via collisions.
  • Short-range interactions: In this case, the particles interact only when they are close together but not necessarily touching. They can be modeled using short-range forces of a type that exists between molecules. Using such forces it is possible to model fluid effects such as the formation and fall of a liquid drop. But these simulations require more advanced methods and will not be covered in this book.
  • Long-range interactions: This category involves mutual interactions between the particles at any distance, such as gravitational or electric forces between the particles. Typically, every particle experiences a force due to every other particle. Clearly the number of computations that need to be performed gets very large pretty quickly as you increase the number of particles in the system. We look at some examples in the last section of this chapter.
  • Local interactions: These are intermediate interactions between short-range and long-range interactions; particles within a certain local neighborhood are linked and interact. Such interactions can give rise to organized systems and connected structures. Examples include mass-spring systems, which can be used to simulate deformable bodies like ropes and clothes. These particle systems are explored in Chapter 13.

So what do we need, in terms of physics and coding, to create a particle system? The answer might surprise you: not a lot beyond what we've already covered in the previous chapters. So there won't be much theory in this chapter, but more on the application of principles that have already been discussed with a few extra tricks added in. That means you get to see code much sooner!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.240.222