Join Brian Bradley for an in-depth discussion in this video Learning the difference between concave and convex meshes, part of MassFX and 3ds Max: Creating Simulations (2013).
We have already discussed the vital role that collision meshes or shapes play in a dynamic simulation. We have also mentioned in passing two very important physical shape types that are available to us: convex and concave holes. If the simple primitive shapes we have access to are not suitable for our particular simulation needs, we may well need to use one of these options. The question is, in any given situation, which one should we choose? Well to make the right choice, we need to first of all understand the difference between the two.
Once we grasp that, we will be able to figure out which of them will fit our current simulation needs. According to one definition, a concave object is something that is hollow or rounded inward with respect to its surface, such as a soup bowl, whereas a convex object surface curves outward or is rounded like the exterior of a sphere. Actually, a flat surface is also counted as a convex surface inside a dynamic simulation, which is a good piece of information to just keep in mind.
To get the concepts of concave and convex clear in our minds, let's take a look at some visual examples, along with a very simple test we can perform that will show us which surface or object type we are dealing with. To test which of our two object types -- that is, convex or concave--we are looking at, all we need to do is simply draw a straight line through one of our shapes. If, no matter what angle we draw the line from, all we see is a single entry and exit point, then we have a convex shape.
However, if at any point we cross more than two edges of our outline--that is, we have more than a single entry and exit point--that would indicate to us that we have a concave shape, one that at some point has a surface indentation. This same simple test can also be applied to 3D geometry. The test criteria of course remains unchanged. If we can draw a line through our object from any angle and have only one entry and one exit point from the volume of our object, then we have a convex mesh.
More than a single entry and exit point would naturally indicate to us that we're looking at a concave mesh. Being able to identify which object type we are working with really is important. There are often limitations on where simulation software like MassFX will allow a particular option or object type to be used, especially is this the case with any concave geometry we may have in the simulation. For instance in MassFX, concave geometry cannot be used as a dynamic rigid body.
It simply will not simulate accurately. Concave geometry only behaves correctly when set as a static rigid body. Now, this of course initially could appear to limit our simulation options. To show that this is not case, let's take a look at a very simple scene consisting of a torus and teapot. By default, 3ds Max does not have the MassFX Toolbar enabled as we have it here. Although we do cover this in the chapter two video entitled MassFX and the 3ds Max UI, if you want to quickly grab this toolbar for yourselves right now, simply find an empty area up on the main toolbar, right-click, and select the MassFX Toolbar option.
Getting back to our torus and teapot, if these were real-world objects suspended in the air as they are, dropping them together would see the teapot drop through the center of the torus, and both objects would naturally come to rest on the ground. But if we just set these two objects to be dynamic rigid bodies inside MassFX and then run a simulation, you can see that actually doesn't appear to happen. Rather than falling through the torus, the teapot appears to sit on top of it. The torus, as we can clearly see, has a concave surface.
It rounds inward on itself. The dynamic rigid body modifier, however, defaults to creating a convex physical or collision mesh that cannot recognize an inward-curving surface. Technically speaking, our torus object cannot be used as a dynamic rigid body in the simulation. What though, if we set a physical shape to concave? After all, it does appear to be an option that is available to us. Well, when we do, and run the simulation again, as you can see, we run into a fairly serious problem.
The torus does allow the teapot to pass through its center but it itself is no longer a dynamic object. It doesn't react at all to the gravity set in the simulation. Thankfully, we can use the tools given to us in MassFX to work around these limitations. Down in the Physical Mesh Parameters rollout, once we switch our shape type over to concave, we get a number of previously unavailable options come to life, one of which is this Generate button. If we click this, MassFX will now create a number of convex holes that are stitched together to encompass the surface of our concave object.
Now, when we run the simulation, we do get the desired end result: the teapot falls through the torus; both objects come to rest on the ground plane. To prove that our objects can indeed interact very nicely, let's reset the simulation, just reposition the teapot a little bit, and then run the simulation once again. As you can see, no problems at all. We can indeed get an even better fit for our convex holes by checking this Improve Fitting checkbox.
Then we just need to click the Generate button once again. Understanding the difference between Concave and Convex surface types is clearly an important piece of the learning-to-create-simulations puzzle. Equally important of course is an understanding of which simulation situations we can and cannot use these mesh types in, although we have seen that with some careful planning and judicious use of the tools available to us--particularly in MassFX--we should be able to deal with most any rigid body simulation setting that comes our way.
In our next video, we are going to take a look at the concepts behind another extremely important set of rigid body simulation tools--these being constraints.
- Setting up your 3ds Max project
- Understanding volume, mass, and density
- Learning the difference between concave and convex meshes
- Discovering Ground Collision and Gravity
- Baking out a simulation for rendering
- Adding an animation override
- Adding Rigid constraints and creating breakability
- Creating springy targets with the Hinge constraint
- Spinning targets with Twist
- Working with mCloth
- Putting a rip in mCloth
- Adding forces to a simulation
- Using fracture geometry in mParticles