Canyon Scene Reconstruction: Using Reconstructed Meshes in Dynamic Simulations

Photo of Rick Barrett

Instructor Rick Barrett

Share this video
  • Duration: 09:22
  • Views: 1822
  • Made with Release: 19
  • Works with Release: 19 and greater

Meshes generated from video using C4D’s Scene Reconstruction can act as collision objects in rigid-body dynamics

In this video, you’ll learn how to create a basic dynamics simulation by creating a Cloner grid of chrome spheres and applying Rigid-body Dynamics. We’ll use the mesh generated via Scene Reconstruction as a collider in the dynamics simulation, so it looks like the spheres are bouncing off the canyon walls.



In the previous tutorials, we have generated a 3D mesh out of video footage. And this is where things really start to get fun because now that we have a 3D mesh, we can do lots of interesting effects with it. And the first thing that we're going to do is use this mesh as a dynamics collider, so that we can have these spheres fall down and collide along the walls of the canyon. So the first thing that we want to do is create a lot more spheres, but I'm going to go ahead and make the sphere itself a little bit smaller. Let's go with something like 200 centimeters. And in order to create a lot of spheres, we're going to use MoGraph's Cloner Object. So, if I hold down the Alt key while I create the cloner, that sphere that I have selected will automatically be a child, and will get multiple spheres. You can see that right now they're all arranged in a line, but I want to arrange them instead in a grid. So we'll choose the Grid Array mode. Now what we want to do is actually increase the spacing between each sphere. And so for that, we'll go ahead and set the endpoint size here to 1,000 centimeters in each direction. In fact, I think I might want a few more spheres than this. Let's go ahead and switch this to a per-step distance, and we'll set the count to five. And you can see that that will actually just build out additional spheres, keeping the distance between each sphere the same. We might actually want these spheres to be a little bit further apart though. So, let me set this to something like 750. I don't want all these spheres to start in a clean grid like this, so I'm going to apply a random effector that's going to randomize the positions. Because I had the cloner selected when I created the effector, it was automatically applied within the Effectors tab. If yours wasn't, simply drag it from the Object Manager down into this effectors list. In the Random Effector itself, I'm going to increase the position offset for these spheres. Let's go with something like 200. And now we need to move all of these spheres up, because we want them to start well above the canyon and out of view. So I'm going to go into the 3D view. And because we have this canyon mesh, we can easily use it as a reference for where the spheres need to be placed. I'm going to choose the Cloner, and go into the Move tool. And so we move this whole cloner up higher. And in the top view, I just want to make sure that the spheres are pretty well aligned with the canyon geometry itself. So we'll move it somewhere like this. Now, if you want to actually see the texture of the canyon, you can always switch this from lines mode into gouraud shedding, and that's going to make it a little bit easier to see how you're placing things in relation to the reconstructed footage. In fact, I'm going to move these spheres back a little bit more. Now what we need to do is make the spheres act dynamically, and to do that we just add a rigid body dynamics tag. So we'll right-click on the cloner, and go down into Simulation Tags, and choose Rigid Body. Now any time you are adding dynamics to a cloner, you need to jump into the Collision tab, and make sure to turn the Individual Elements to All, and that way, each individual clone will be treated as a separate object. So now if we go ahead and hit Play, and I'll activate our perspective view here, if we hit Play, you'll see that those spheres start to fall down. They're not actually colliding yet with the walls of the canyon. In order to do that, we need to actually right-click on the scene mesh. Go down to Simulation Tags and choose the Collider Body option. And now, these spheres will actually collide with the walls of the canyon. Well, not quite, and that's because this is a concave surface. So the spheres are actually colliding with the outer boundary of the surface. In order to collide with the walls themselves, we need to go down here into the Collision tab of the Collision Tag and set the shape to Static Mesh. Static Mesh is just a mesh that's not going to actually be dynamic or move itself, but it allows the dynamics engine to actually calculate the concave surfaces of the mesh. We'll go ahead and rewind and play again. And now we can see that the spheres are going to collide properly and fall down into the canyon. Now, dynamics always puts too much bounce onto the objects, in my opinion. These spheres are not supposed to be bouncy, they're supposed to be sort of more metallic. So I'm going to select both the Collider Tag as well as the Rigid Body Dynamics Tag. Here in the Collision tab, I'm going to reduce the bounce down to maybe 5%, and I'm also going to increase the friction upto something like 80%. And for me, that gives me a much more realistic-looking result. And now you can see how those spheres are sort of falling right down into the canyon. I think we can probably make our spheres a little bit smaller, so let's go ahead and drop them down to 150 centimeters. I also don't like how everything's falling down really as an even grid still, so I'm going to go back into the Random Effector and adjust the randomness here a little bit more. Let's go to X randomness of 400, and we'll increase the wiring in this quite a bit, maybe something like 500. And I think I'm also going to activate Scale so that we can get a little bit of variance in the size of the spheres. And now let's see what that looks like. A little bit better, and we could tweak this to our heart's content really. The one thing I want to do now is point out a little bit of an issue that we're going to get when we render. Let's go ahead and render here. And you'll see that the shadows here are being cut off by the geometry. And this might happen to you depending on where your objects are versus where your reconstructed mesh is. You could obviously cheat the lights so that the shadows won't fall across that line, or we can go into the scene mesh itself, and we'll go into Edge Mode. I'm just going to select this edge, and Ctrl+drag the Z-Axis to extrude that edge outward. And that's going to create some additional polygon out this way in order to have that shadow not cut off there. Looks like I need to go even a bit further, so we'll just stretch this out further, and we can drag out this one as well. And we'll drag out this way, just so that we have some mesh underneath there to catch those shadows. So now, we're ready to render out a sample of this. And for that, we'll just go ahead and go into the render settings. I'm going to use the physical render, make sure that we're outputting all frames, and make sure that we're outputting the same size as our footage itself. In the physical settings, I think that this might work well with some motion blur. Of course, that's going to require higher sampling levels. So we'll increase the sampling sub-divisions to three, maybe let the max sampling sub-divisions go all the way up to five, increase the blurriness subdivision. We don't need anything in the ambient occlusion or subsurface scattering sub-division because we're not actually using those. So we'll go ahead and see what our render quality looks like with those settings. And of course, when rendering with motion blur, we need to tweak the actual shutter angle of the camera or the shutter speed of the camera in order to adjust the blur. Right now it's one-thirtieth. You won't see the blur in the viewport, so we'll have to render a single frame in the picture viewer in order to see what the motions blur's looking like. It's probably a little bit too blurry at this point, so I think I'm going to go up to one-sixtieth of a second and see if that looks better. We want to a little bit of blur, but we don't want to overkill the motion blur. That's looking pretty good, and so I'll go back into my render settings, and turn this back to All Frames, and go ahead and render this out. So that gives you an idea of how to create a dynamic simulation using a reconstructed mesh from video footage. And the possibilities of these are really great. And of course, you can continue to tweak on this. In our next tutorial, we're going to look at another set of effects for how to represent sort of an augmented reality type of a view, showing wireframe over the existing video footage.
Resume Auto-Scroll?