Skip to content
Home » Tunnel Animation with Follow Path Constraint

Tunnel Animation with Follow Path Constraint

Spread the love

Today we’ll make a simple tunnel animation using the follow path constraint, in which the camera will move along a path inside a tunnel. I’m going to use the 2.82 version of Blender. We’re going to cover the following techniques and topics:

  • Bezier Circle curve
  • Follow Path Constraint
  • convert curve to mesh
  • Displace modifier
  • Voronoi texture
  • Bump node
  • Noise texture

Here’s the video version:

And here are the steps:

Step 1 – Add a Circle Curve

Delete the default cube. Add a Circle curve (make sure to add a curve, not a mesh). Scale the curve: S 5

Add a Circle Curve

Step 2 – Add the Follow Path Constraint

Select the camera and reset its location by hitting Alt+G. Then in the Object Constraint tab add a Follow Path constraint (A) and select the BezierCircle you just added as the target (B).

Add the Follow Path Constraint

Step 3 – Try Increasing the Offset

With the Follow Path constraint in place, play with the offset. If you now increase the offset by dragging your mouse cursor over the Offset box, you will see that the camera indeed follows the path but faces the wrong direction most of the time.

Try Increasing the Offset

Step 4 – Check the Follow Curve Box

Set the Offset back to 0 (A) and check the Follow Curve box (B). Now you can hit R twice and rotate the camera so that it points in the direction you want. If you now change the Offset, you will see that this time the camera always faces the right direction.

Check the Follow Curve Box

Step 5 – Edit the Curve

Select the Circle curve and go to edit mode. Select one of the four vertices and move it slightly down by hitting G Z and dragging it down (A). This will add some variation to the shape of the tunnel. Repeat the same step for the opposite vertex (B) and then select one of the other vertices and move it slightly up (C). The fourth point may stay untouched.

Edit the Curve

Step 6 – Play with the Offset

Go to object mode, select the camera and play with the Offset again just to make sure everything is still working fine. If necessary, you can adjust the camera by hitting R twice again and rotating it as needed.

Play with the Offset

Step 7 – Rename the Curve with the Follow Path Constraint

Set Offset back to 0. Then select the Circle Curve – the one you added the Follow Path constraint to – and rename it ‘Path’ in the Outliner. In order to do it just double-click on its name and type in the new name. We’re doing this because in the next step we will duplicate the curve to turn it into the tunnel itself. So, the tunnel and the path will have the same shape.

Rename the Curve

Step 8 – Duplicate the Curve

With Path still selected, duplicate it by hitting Shift + D and then immediately press Esc so that the duplicate stays in place. Rename the duplicate ‘Tunnel’ in the Outliner.

Duplicate the Curve

Step 9 – Add Geometry

Now the Tunnel is just a curve, without any geometry. We have to give it some geometry, so with Tunnel selected go to the Object Data tab (A) and under Geometry set Depth to 0.26. Now the camera is hidden inside the Tunnel.

Add Geometry

Step 10 – Convert Curve to Mesh

We’re going to convert the curve to mesh. You can do it in the Object menu by selecting Convert to -> Mesh from Curve/Meta/Surf/Text.

Convert Curve to Mesh

Step 11 – Create a Voronoi Texture

Now the Tunnel is a mesh. But it’s a bit too smooth. Let’s add a Displace modifier to make its shape a bit more irregular. We’ll be using the modifier with a texture, so let’s create the texture first. Go to the Texture tab (A) and add a texture. Set its type to Voronoi (B) and Size to 0.50 (C).

Create a Voronoi Texture

Step 12 – Add a Displace Modifier

Go to the Modifiers tab and add a Displace modifier. From the drop-down list select the Voronoi texture you just created (A) and set its Strength to 0.3 (B). Now the Tunnel looks more irregular in shape.

Add a Displace Modifier

Step 13 – Set the Camera

Select the camera and go to camera view by hitting 0 on your numpad. Go to the Object Data tab (A). The Focal Length doesn’t allow you to see much, so reduce it to 15 (B). If necessary, rotate the camera slightly up or down so that both floor and ceiling are partially visible.

Set the Camera

Step 14 – Play with the Offset in Camera View

Still in camera view go to the Constraint tab (A) and play with the Offset again (B) to make sure the camera can see what you want to be seen along the whole path. If you are not fully satisfied, just adjust the camera even more.

Play with the Offset in Camera View

Step 15 – Go to Rendered Shading

Set the Offset back to 0. Go to Rendered shading. Looks like it’s a bit too dark. We’ll need the light to be somewhere closer to the camera.

Go to Rendered Shading

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

Step 16 – Reset the Light

Go to top view, Wireframe shading so that you can see the camera and light better. Select the light and reset its location by hitting Alt+G. In the Object Data tab make sure it’s a Point light (A) and set its Power to 100 W (B).

Reset the Light

Step 17 – Add a Follow Path Constraint to the Light

We want the light to move along with the camera, in front of it. We could do it by parenting the light to the camera, but we’re going to leverage the Path curve we created before. With the light selected add a Follow Path constraint and as Target select Path. Now the light is at the same location as the camera, but we want it to be in front of it, so set the Offset to 20. This distance looks OK to me.

Constrain the Light

Step 18 – Go to Camera View

Go to Rendered shading, camera view (0 on your numpad).

Go to Camera View

Step 19 – Add a Material to the Tunnel

Select the Tunnel in the Outliner (A) and go to the material tab (B). Add a new material and set its color to green, hex 28830E (C), and Metallic to 0.5 (D).

Add a Material to the Tunnel

Step 20 – Set the Light’s Color

Select the light in the Outliner and in the Object Data tab set its color to hex FF9447.

Set the Light's Color

Step 21 – Add Bumps to the Walls

The walls of the tunnel are still too smooth. Let’s add some bumps to them. Go to the Shading workspace (A) and select the Tunnel in the Outliner (B). Add a Bump node (C)  – you can do it in the menu or by using the hotkey Shift + A, so the same as the one to add objects in the 3D View editor. You will find the Bump node under Vector. Connect the Bump’s Normal to the Principled Shader’s Normal. The Principled node was created the moment you added the material in the material tab. Make sure Bump’s Strength is set to 1 and set Distance to 1.5.

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Then add a Noise Texture node by selecting Texture -> Noise Texture in the Add menu. Connect its color to Bump’s Height. The Noise Texture consists of small areas of different colors, so now each change in color will correspond to a change in the height of the bumps. In the Noise Texture node set Scale to 2 and Detail to 10.

Add Bumps to the Walls

Step 22 – Get Ready for the Animation

We’re done with the material. I’m going to keep it simple. Go back to the Layout workspace and then to the Output tab (A). There you can see that the Frame Rate is set to 24 (B). If it isn’t, just set it to this value. This means there will be 24 frames every second. We want the animation to be 10 seconds long, so it must consist of 240 frames. So, set the End value in the Timeline to 240 (C).

Get Ready for the Animation

Step 23 – Keyframe the Offset in the Follow Path Constraint

Now we’re ready to animate the camera, so select it in the Outliner (A). In the Timeline go to frame 1. You can do it by pressing the button on the left (B). The camera is going to move along the path, but the property we’re actually going to animate is the Offset. So, go to the Object Constraint tab (C). The Offset is now set to 0. Right-click on the Offset to insert a keyframe (D). You can now see the keyframe at frame 1 in the Timeline and you can also tell there’s a keyframe because the color of the Offset box has changed.

Keyframe the Offset

Step 24 – Add Another Keyframe to the Follow Path Constraint’s Offset

Now go to the last frame, which you can do by pressing the button on the right in the Timeline (A). Set the Offset to 100 and insert another keyframe (B).

Add Another Keyframe

Step 25 – Play the Animation

Now go back to frame 1 and play the animation. You will quickly notice that the camera is moving along the path, but the light isn’t and it gets very dark in the tunnel. We want the light to also move along the path and keep a constant offset to the camera.

Play the Animation

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.

Step 26 – Keyframe the Light’s Offset in the Follow Path Constraint

In order to animate the light, let’s first select it in the Outliner (A). Make sure you’re at frame 1, because this is where we want the animation to start (B). As you can see in the Object Constraint tab, the Offset of the light is 20. And this is the constant offset we want to keep, which means the light should be at any time during the animation 20 units in front of the camera. Right-click the Offset box and insert a keyframe (C).

Keyframe the Light's Offset

Step 27 – Add Another Light Offset Keyframe in the Follow Path Constraint

Now go to the last frame (A) and set the Offset to 120, which corresponds to the camera’s offset of 100 plus the light’s offset of 20. Insert a keyframe.

Add Another Light Offset Keyframe

Step 28 – Play the Animation Again

Now go to frame 1 and play the animation. This time the light is moving along with the camera.

Play the Animation Again

Step 29 – Render Settings

We are now ready to render the animation. Go to the Output tab (A) and select a folder where your animation will be stored (B). Set the File Format to FFmpeg video (C) and under Encoding set the Container to MPEG4 (D).

Render Settings

Step 30 – Test Render

Before we start rendering the animation, let’s make a test render. Go to any frame you like (like frame 120 in my case) and render the image.

Test Render

Step 31 – Render the Animation

If you are satisfied with the image, you can start rendering the animation. Don’t forget to save the file before. And now go to the Render menu and select Render Animation. It’s going to take a while.


Spread the love

Leave a Reply