Copyright © 1997 Dynamic Realities

Miscellaneous Legalities | Credits and Acknowledgements | Other DR produces | How to contact Dynamic realities



Main
Theory of Operation
Entering Particle Storm
Camera
Particle Groups
Collision Detection
Death wish
Drag
Force Fields
Fountain Emitter
Flocking and swarming
Gravity
Particle Shader
Wind
Particle Storm Post Process
Tutorials
Appendecies


Collision Shapes Explained
by David J. Vrba


Particle Storm offers a few selections when it comes to collision detection. The choices are: a sphere, a box, and most any complex .lwo object. Each is successively more complex and time consuming then the previous. This section discusses the complex .lwo object selection for collision detection.

In order for this form of collision detection to be used successfully, a few guidelines must be followed when creating the object (hereafter referred to as the 'shape'). If an error exists in the shape, it may confuse the collision detection algorithm. As a result, particles could pass right through portions of the shape, while others could hit the shape at places that don't even look like part of the shape. The guidelines will be discussed below, but, first, some terms could use definition.

There are basically two problems Particle Storm must solve for each particle at each instant of time: "Did this particle touch the shape since the last time we checked it?" and "If so, where should it be now?" The first question is the collision detection phase, and the second is the collision response phase.


Convex/Non-Convex Shapes:

There are dramatically different approaches for collision detection of convex shapes and non-convex shapes. An example of a convex shape is a box. None of the sides of the box meet an adjacent side with an angle greater than 180 degrees (measured at the inside). A non-convex shape is one that does not fit this description. An example of a non-convex shape is a donut.

Rules of the Game:
All polygons must be 100% flat. Non-flat polygons can be triangulated to make them flat (all triangles are 100% flat).
Any One-point and Two-point polygons are ignored.
Any polygons that have no surface area are ignored.
No overlapping polygons are allowed. Overlapping polygons occupy the same space but they are not necessarily coplanar (in the same plane). Polygons that penetrate one another are considered overlapping polygons.

The shape must be completely enclosed and have 'thickness' throughout. Imagine placing a visible gas into the inside of the shape. If any of the gas were to escape from the inside, then the shape would not be completely enclosed.

With these rules in mind, let us look at an example of a bad shape and what can be done to correct it.

The coffee table object "\ OBJECTS\ FURNITUR\ COFFEETA.LWO" that comes with LightWave 3D is a good example of an object that renders right but is not suitable for collision detection. The figure below shows how this object looks in the modeler portion of LightWave 3D.

The first problem is with the four legs of the object: there are no tops or bottoms to them. This violates the enclosure condition. This figure shows the object with the new polygons highlighted.



Second, the four trim boards mounted just under the table top do not have tops. This also violates the enclosure condition.


Last, the lower shelf board is penetrating the legs. This is an example of overlapping polygons. To fix this, use the boolean subtract feature of modeler to remove the parts of the shelf that intersect the legs. This last figure shows the completely corrected coffee table.


In essence, since the coffee table was made of multiple pieces, legs, shelf, top, each piece must be designed as an enclosed object.