Unlimited WordPress themes, graphics, videos & courses! Unlimited asset downloads! From $16.50/m
Advertisement
  1. 3D & Motion Graphics
  2. 3D Studio Max
Cgi

Understanding 3D Camera Tracking: Part 2

by
Difficulty:IntermediateLength:ShortLanguages:


Screencast

1. Project Setting

Step 1

Open After Effects.

Open After Effects
Open After Effects

Step 2

Go to Composition > New Composition to make a new composition. 

Set the Width and Height values to 1280 and 720 respectively. Set the Frame Rate to 25 and Duration to 12 seconds. Click on OK.

Composition  New Composition
Composition > New Composition

Step 3

I've provided the live action footage, which can be found in the attachment of the tutorial.

Go to File > Import > File to import the image sequence. Alternatively, press Ctrl-I keys.

With the first image of the image sequence selected, turn on JPEG Sequence option. Click on Open.

File  Import  File
File > Import > File

Step 4

With the image sequence selected, drag and drop it inside the composition. You'll see the footage in the comp view.

Comp view
Comp view

2. Camera Tracking in After Effects

Step 1

With the image sequence layer selected, go to Animation > Track Camera.

Animation  Track Camera
Animation > Track Camera

Step 2

The 3D camera tracker system starts analysing the footage. It analyses the footage in two steps, hence it might take some time to complete.

Analyzing footage
Analyzing footage

Step 3

After a couple of seconds, the analyse process ends. Now you can see several track points in the scene.

Analyzing done
Analyzing done

Step 4

These track points would help to generate the dummy 3D plane/null and the camera. You need to select at least four points to generate the helping dummy or layer. Select several track points on the ground as shown in the following image.

Tracked footage
Tracked footage

Step 5

With the indicated points selected, secondary-click the mouse and select Create Solid and Camera

Create Solid and Camera
Create Solid and Camera

Step 6

You get a solid layer and 3D camera in the timeline. This solid layer is the placeholder and sticks with the footage and follows the camera.

3D camera
3D camera

3. Exporting Camera Data to 3ds Max

Step 1

Go to http://aenhancers.com/viewtopic.php?t=991 and you will find that they've released a free script AE3D for After Effects. Download the script from there. 

Alternatively, the script has been supplied with the tutorial also. Just copy the script and paste it in the Script folder of After Effects.

AE3D
AE3D

Step 2

You need to restart After Effects. Open the same composition again. With the null object and 3d camera layers selected, go to File > Script > AE3D_Export.jsx.

File  Script  AE3D_Exportjsx
File > Script > AE3D_Export.jsx

Step 3

In the AE3D window, select the 3ds Max option, set the file name to camera tracker.ms and then click on Export. This saves the 3ds max script file on the desktop.

camera trackerms
camera tracker.ms

4. Creating Scene in 3ds Max

Step 1

Open 3ds Max.

Open 3ds Max
Open 3ds Max

Step 2

Go to MAXScript > Run Script.

MAXScript  Run Script
MAXScript > Run Script

Step 3

It opens the Open File window. Here select the camera tracker.ms script which was exported from After Effects. Click on Open.

camera trackerms
camera tracker.ms

Step 4

You get a 3d camera and one dummy in the scene.

3d camera and one dummy
3d camera and one dummy

Step 5

Jump in the perspective view and press C key for the camera view.

Jump in the perspective view
Jump in the perspective view

Step 6

Right now the camera is looking downwards which is incorrect. You need to correct the coordinate of camera.

Correct the coordinate of camera
Correct the coordinate of camera

Step 7

With the camera and dummy selected, group them together.

Group Camera and Dummy
Group Camera and Dummy

Step 8

After grouping, jump in the left view port. Select the Rotate tool and rotate it to the right side. Your goal should be to put the dummy on the grid line.

Rotate tool
Rotate tool 

Step 9

Adjust the dummy a little bit more to make it straight. 

Adjust the dummy
Adjust the dummy

Step 10

Jump in the camera view. Press Alt-B keys to open the Viewport Configuration window. Turn on Use Files and Animate Background options. Click on Files.

Viewport Configuration
Viewport Configuration

Step 11

This opens Select Background Image window. Here select the first image, turn on Sequence option and click on Open.

Sequence option
Sequence option

Step 12

Turn on the Show Safe Frame option in the camera view. Alternatively, you can press Shift-F keys.

Show Safe Frame option
Show Safe Frame option

Step 13

Now you can create any 3d asset in the scene. I have created a Chamfer Box and placed it around the dummy in the scene.

Chamfer Box
Chamfer Box

Step 14

At this stage, if you render the complete scene and play the video, you'll notice some sliding problem with the 3d object. 

To overcome this problem, you should put the dummy at half of the black grid line as shown in the following image.

Avoid sliding problem
Avoid sliding problem

Step 15

Create a plane and put it beneath the 3d box. Apply Matte Shadow on to the plane. 

Matte Shadow
Matte Shadow

Step 16

Apply the concrete texture on to the box.

Apply the concrete texture
Apply the concrete texture

Step 17

Create several lights in the scene. You need to check the direction of the real light source of the scene and mimic the same lighting structure in the 3d scene.

Create several lights
Create several lights

Step 18

Render the frame and you will see the 3d concrete pillar is perfectly merged with the scene. You can now render the whole sequence and when you play the video you will see the 3d concrete pillar is perfectly matching with the live scene.

Rendered frame
Rendered frame

Conclusion

I hope you found this tutorial interesting and useful. In the next part of the series, I'll show you how to merge animated 3d sequence into a live action scene using 3d camera tracking system.

Advertisement
Advertisement
Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.