I found myself recently needed some rocks… I could easily download a collection of rocks, but I figured it would be extremely easy to just make my own. My first thought was to simply take a cube, smoothly sub divide it a number of times, and apply a displacement modifier to it. The end results however didn’t really bring the results I wanted:
By the way, you can learn more about using the Displace modifier on my earlier tutorial on using Blender for level creation.
Ok, apparently this is going to take more than a few seconds… hey… I wonder if there is a plugin? Turns out, yes, yes there is. The plugin add_mesh_rocks does exactly what it says. You can download a tarball of the plugin here using the snapshot link. You can get instructions for installing (a different but same process) plugin in Blender here. Download and enable the plugin.
Once you’ve downloaded and enabled the plugin, there is a new option in the Add->Mesh menu, Rock Generator:
NOTE*** There seems to be a bug, the option wont be available if there isn’t any existing geometry in the scene.
Ok, I admit, that looks a bit more like a kidney bean than a rock, but it’s a start. If you look in the Tool (T) panel, you will see initial creation options for Rock Builder:
Click Generate materials if you want it to create a starting rock texture for you. Every time you change any setting, you will get a completely different rock, like so:
If you don’t want this behavior, turn off the random seed setting. Once you’ve got a rock you are happy with… let’s destroy it!
Before we go to far though, if you dont want performance to absolutely crawl, we want to apply several modifiers that were created as part of the rock creation process. Go to the modifiers tab and start applying the various modifiers:
OK, back to destruction. The first and most obvious option is the Explode modifier. There are a few steps we have to take here… first go into edit mode, select all the vertices and in the vertex data tab create a new vertex group. Now apply first a particle system modifier, then an explode modifier. Finally wire up the vertex group, like so:
The problem with explode is that it applies to the hull of the object only, so the results may not be way you want… as you can see:
In some cases, that effect might be exactly what you are looking for. Oh, and I turned gravity off to get the effect above. But if you instead want things to be a bit more… substantial, it’s time for a rethink. In fact, it’s time for another plugin, but thankfully this one ships with Blender, it just needs to be enabled. What you are looking for is “Cell Fracture”:
Once enabled, in Object mode, there will now be a new option available in the Edit section of the Tools tab:
Cell Fracture will split your object up into several solid pieces. You’ve got tons of control over how the fracturing will occur.
What I personally did was changed source limit (number of pieces) down to 12 and unchecked “Next Layer” so the fracture occurs in the primary layer. Now you will notice you’ve got several meshes instead of one:
In fact, you can now get rid of the source rock if you want. You will notice your rock is actually 12 rocks now:
Instead of using a particle system like we did with explode, we are going to use Dynamics (Physics) instead. Select all of the objects, switch to the physics tab and select Add Active.
This means all of our rocks will now participate in the physics engine. To see the result, quickly add a plane to the scene, make it a rigid body and turn dynamic off:
And now press play in the timeline:
Now that looks much more realistic! Now, what if we wanted our rock to explode instead of fall? Well, physics are once again coming to our aid! This time add a force field to the scene:
Then crank the strength way up (or lower the mass of your objects), like so:
Once again, I don’t want gravity to be part of the process, so I turn it off. In the Scene tab, simply turn off gravity, like so:
And voila, exploding rocks!