Canyon Scene Reconstruction: Generating Topographic Lines from Reconstructed Meshes

Photo of Rick Barrett

Instructor Rick Barrett

Share this video
  • Duration: 10:57
  • Views: 967
  • Made with Release: 19
  • Works with Release: 19 and greater

Create Contour Lines from any Mesh, including meshes generated via Scene Reconstruction.

In this tutorial, you’ll learn two techniques that can be used to create and render topographic contour lines for a 3D mesh. First we’ll explore how to render contour lines via Cinema 4D’s Sketch & Toon module, and then we’ll use a different technique to create contour splines that can be easily controlled and art-directed with the help of the MoSpline object and MoGraph effectors.

Less...

Transcript

In this tutorial, we're going to generate topographic contour lines based on the reconstructed mesh from our video footage of this canyon. And to do that, what I've done is jumped back to the scene file immediately after we completed the mesh reconstruction. That was part five. And I did that just because things were getting a little bit slow and I wanted to simplify things to explain this technique. Now, one way that you can create contour lines is using Sketch and Toon, and to do that, you'll go into the Render Settings and go down into the Effects, and choose the Sketch and Toon effect. On the Lines tab, you want to turn off all the other line types and just turn on Contour. And you want to set the contour to be generated along the Object Y coordinate. And if we render now, you'll see those lines, contour lines, being generated along the contour of the canyon. And you can, of course, adjust the distance between the contour lines. If you want to get rid of the shading of the canyon, you can go into the Shading tab here and set the object to Background. And now when we render, we're just going to get the black lines on the white background. And of course, you can adjust the background color, you can adjust the sketch lines. There's quite a bit of options available here, but I do find that when I'm doing sketch lines, it's a little bit hard sometimes to art-direct the actual drawing of the lines and get exactly the look that I'm going for. So, I'm going to show you another technique that actually was introduced to me here on Cineversity by Russ Gautier from Perception. You can check out that tutorial in the Related Tutorials below this one. But I'm going to show you how easy this is to generate topographical lines that are very art-directable. So what we're going to do is create planes at each level that we want a topographical line. So I'm going to jump over here into top view and I'm going to go ahead and zoom in a little bit and we're going to create a plane primitive. Now that's really tiny in the scale of our scene so we're going to go ahead and start by making it 10 times bigger. And now I've got my orange dots, and I can easily drag this out to encompass the entire canyon, and we'll move this over so that the plane covers the canyon. And now, we're going to go over here into the front view, and you see here that our first level is already down here at the ground level. We want to create multiple copies of the plane from here so we're going to use the Cloner object once again. And once again, I'm going to hold the Alt key down as I create the Cloner, that makes the cloner a parent of the plane and we're generating three copies of the plane. And of course, we can increase this count and we can adjust the per step distance between each plane. So, you can adjust this based on how many topographic lines you want and the distance you want between them. I'm going to go with something like this, 20 planes and 225 centimeters between each contour line. What we need to do now is actually connect all of these planes together so that Cinema 4D sees them as a single object, and to do that, we're going to use the Connect object. So once again, I'm going to hold down the Alt key as I create the Connect object and it's going to create it as a parent of the cloner object. So now, we're connecting all of those cloners together. Now, what we want to do is create a boolean, and to do that, we're going to use the Boole Generator. So once again, I'm going to hold down the Alt key and create a Boole Generator. Now, the boolean operation that I want to perform is to subtract all of these planes from the mesh that I generated from the video footage. So I'm going to Ctrl+drag my scene mesh up here as the first child of the boolean. I want to make sure to create a copy so that I've still got my mesh here if I need it later, but I'll go ahead and hide the original mesh. Here in the boolean object, I want to turn on a couple of options. I want to create a single object and it'll take a second for that checkbox to hit because this is a complex boolean. I also want to select the intersections and you'll see why in just a second, that's going to make things super fast. Now, I'm just going to go ahead and make this boolean object editable, and that's going to perform the boolean and give me a final polygonal object. This is going to take a second because it is a complex boolean, that's a very complex mesh that we created. And once it's done here, we have a polygonal object that is the landscape minus all of those planes that we created. But what's really important here is that we have this Edge Selection. Let's move back into the perspective view so that you can see this. I'm going to go ahead and double-click on this Edge Selection, and you can see that it's selected all of those lines. Now, what I'm going to do is convert those lines into splines using the Edge to Spline command. You'll find it in Mesh, Commands menu. And now I have a spline, and I'm going to pull that out and I'm going to delete this boole object. So here we have all of those splines in 3D space for all of our contour lines, and you could render these splines using the Hair Engine or Sketch and Toon, or using a Sweep object. One of the things that I find really handy to be able to animate these in a way that I can really easily control is to drop the spline into a MoSpline. So you'll find the MoSpline in the MoGraph menu, and what we can do is put the MoSpline into Spline mode, and this is going to generate a new spline based on the source spline that we're going to drag here into the spline field. So we'll drag in the completed contour lines that we just generated, and I'm going to hide those contour lines so that we're just looking at the MoSpline. Now, within the MoSpline itself, we can go into the Object tab and we can animate the start and the end parameters to animate these contour lines on, but it's evaluating all of the segments of the spline and the directionality changes with each spline. And we could clean that up by reversing individual segments but to make things super easy, we can simply control this MoSpline with effectors. So I'm going to go ahead and create a Plain Effector, and I think you've seen this story before, we're basically going to create a Linear Falloff and we're going to animate the scale of the spline. So we'll go into the Uniform Scale and set this to minus one, and we want to make sure that that plain effector is applied to the Effectors tab of the MoSpline. And we're not really going to see this until we put the MoSpline into a Sweep object. So let's go ahead and do that. We're going to hold down the Alt key as we create a new Sweep object, and Sweep objects needs some sort of a profile that they're going to sweep and it's often a good idea to use an n-Side primitive for that because you can control the segments that are occurring in that Sweep. So I'm going to hold down the Shift key now as I create the n-Side, and it's going to automatically make it the first child of that Sweep that I had selected. Now, I'm going to hide the MoSpline so that we're just looking at the Sweep, and you can see that... Well, you can't see it and that's because the MoSpline is controlling the width of these lines. I'm going to go in here and increase the width, and now you can start to see those contour lines. And if I select the Effector and move it in Z-space, you'll see that those contour lines are animating on and off the screen, much like we've done with the wireframes and with the points. So, again, I'm going to want to go into my Falloff and invert it so that it goes to the correct direction and we're going to go ahead and move our time backwards here, move our Effector all the way back here to the beginning, and we'll go into the Coordinates tab and keyframe the Z position. Now, I'm going to go ahead and move this all the way to the back of the frame so that my lines are fully drawn, and in order to set a keyframe on a later frame, hold down the Alt key before you scrub the time slider, and that's going to allow you to scrub without actually changing the position. And we'll go ahead and set this keyframe at the Z position. So now, we have those contour lines drawing on around our canyon. Now, like we did with the wireframe, we want to go ahead and bring the canyon mesh back in so that we're hiding the lines that should be hidden by the canyon itself. So we'll go ahead and pull that back in, and once again, I'm going to go in and simply drop the mix strength of the canyon itself so that everything turns black. We need to make sure to turn off the rendering of Sketch and Toon here so things stay nice and fast, and you can see that here we have our contour lines. Once again, we're going to go ahead and create a luminate cyan material for those contour lines. Actually, let's live on the wild side and make it pink. And we'll drop those, drop that onto the sweep. And now, we have contour lines from the canyon and they will grow on and animate on in Z depth as the camera moves through the canyon. The animation's happening a little bit fast so I think I'm going to go ahead and move the end point here much later so that it'll take a little bit longer for those lines to draw onto the screen. So that's a quick technique for how to create contour lines based on scene reconstruction from your video footage. I hope you've enjoyed this tutorial series and I'm not necessarily closing the book. I'm sure there's other things that we can do with this canyon. I look forward to seeing what you do with your scene reconstruction projects.
Resume Auto-Scroll?