Tutorials

By Jeff Mottle

Animated Camera Mapping by Chris Bullen

Editor's notes

Article brought to you by Chris Bullen
Jeff Mottle — Founder at CGarchitect

Animated Camera Mapping Tutorial by: Chris Bullen - Element2
 

This is a powerful technique to create engaging animations from static stills or context shots. This technique is widely used in cinematic productions to bring life to a static camera shot, or matte painting, by creating the illusion that one is traveling within a 3-D environment when in fact it is only a digitally enhanced 2-D image.
 

 

 

The best way to describe this is to imagine a slide projector with the image you wish to walk through being projected onto some basic geometry. The image will only be shown where the light is projected. This means that there would be no image where there are shadows and any object whose surfaces fall away from you (like a sphere or cylinder) would have texture stretching if you would make any exaggerated lateral movement. Once you finish this tutorial, you'll see the limitations this technique has, but you will also see the tremendous power that this technique holds. Take a look at the completed scene and play with it to see the set up!

I've chosen the following royalty-free image to explain.

By examining the shot, we can break down our approach by deconstructing the scene into basic shapes. For the most part, the building can be considered to exist on one plane. We'll start here and refine our solution as we progress. The most dominant element is the portico. This consists of the deck, columns and pediment. If we were actually on site viewing this image, we would be able to take several steps to either the left or right to reveal what lies behind the columns. Unfortunately, we are not given this luxury with a still image. This is where other reference shots or our imagination will take over. We'll need to take this image into a photo manipulation program, like Photoshop, to create a modified texture to use for the building. Essentially, we need to get rid of objects in the foreground. With a little digital elbow grease we can create the following image by cloning out what we don’t want. The techniques used below will be explained in another tutorial on Photoshop.

Now we’re ready to create the scene. You can choose to create the geometry in real world units so as to place other CG elements within the scene and have them at scale, or you can choose the shot to strictly be an artistic representation of the image. We’ll choose the later in this case since we’re only examining the technique.

Start your 3D software and place the image on a 3D plane making sure to preserve the bitmaps aspect ratio. You will have to make the bitmap visible in the viewports in order to continue. This is also where you may wish to try to scale the image in real units to create a fairly accurate scene. To do this, make one of the features (like the window) of known dimension an accurate size.

For this tutorial we’re using 3DS MAX but this technique is applicable for any software with camera mapping functionality. You should have something similar to the following.

Next we’ll use the image as a template to create some basic geometry. The cool thing with this technique is that you don’t have to be totally accurate to create very convincing results. By switching to the front view, we create the following geometry. Note that the plane object we used to create the basic geometry will be used again for the building in the camera map.

Use common sense when creating your geometry. For example, the building in the image has a set depth for the portico. We don’t know the exact measurements from just the image, but we have an idea as to how far the portico may extend. Also be aware of the axis that you may be pulling vertices around in as it is easy to get things “out of square” quite easily by moving in the XY plane as opposed to just the X axis. The geometry doesn’t have to be precise in this stage as it will need to be fudged when we camera match.

Now we need to create a camera and match the shot closely, but not necessarily exact. In order to do this, we need to place the image of the building as a viewport background. We can do this in 3DS MAX by selecting an active viewport and pressing alt-b to open the viewport background dialogue. Select File… and choose the same image you used for the plane, making sure to select Match Bitmap.

Now we should have an image similar to the following ready to create a camera!

Create a target camera and match the perspective as close as possible by playing around with the camera and target positions as well as the focal length if necessary. You’ll notice that things line up close but you’ll still need to fudge the locations more accurately.

Notice that the perspective is not 100% accurate. Don’t let this bother you as it is close enough for this technique. Now look at the patio. The front view showed it to be at the right height but in the camera view, it’s not high enough. Correct this by moving the box up in the Z axis until its height is right. You may also require the height of the box to be taller. You will also need to adjust the size of the plane object that we’re using for the house to fill the frame. Notice the columns are out of whack slightly as well. This can be corrected by moving the columns laterally in the X or Y axis and adjusting their radius and taper. Other things may present themselves such as the ceiling of the portico not matching up with the transition point of the ceiling and wall in the image. Again, play around with location and size and shape of the box in 3D space until you get it matched closer. See the following image after we have fudged everything.

The set up is complete and the rest is incredibly simple. We basically have two images to apply as textures to the scene. The only difference is that instead of using traditional UVW maps, we’ll use camera mapping.

A little note before we go on. Prior to MAX 7 we had to make sure the geometry was tessellated enough to avoid “texture munching”. That is we needed to have enough vertices to define how accurately the texture will be mapped onto the geometry. If there weren’t enough vertices, the texture was shifted and fragmented and didn’t appear smooth. This was fixed by applying a tessellation modifier with high settings to create enough vertices. Now in MAX 7 there is a camera map per pixel which allows you to use low poly geometry to camera map the image on. We’ll use the camera map per pixel (located as a material type) instead of the camera map modifier (which can be applied like any other modifier in MAX).

Select a new material in the material editor and click the diffuse channel slot. This will open the Material/Map browser window where you can choose Camera Map per Pixel as the map type.

Now you’re presented with the following.

Click on the Camera button and select the camera we created for matching the shot. Then click on the texture button to select the image with the Portico removed. Name this material “House” and make the material 100% self illuminated. Copy this material to a vacant slot and name this copied material “Portico”. Now in the Portico material, click the Texture button and choose the original image.

Select the plane object and apply the House material. Now select everything else and apply the Portico material to it.

We’re almost ready to render the image! The only thing left is to match the rendering output to the original image. In this case the original image was 480x293 pixels. When you render you’ll get the following which looks remarkably similar to the photo.

To create an animation, clone the camera we’re using for the camera map as a copy and animate the camera motion moving into the shot. This will give you the parallax and make the image look as though it’s a real video.

Now you’ll need to see where the limitations of this technique exist. Start by tweaking the dolly animation to move slightly side to side. You’ll see that there is a range at which this technique holds its own, but if you deviate too far away you’ll see some texture stretching and anomalies from the process. For the most part, if this is to be the background of an animated scene, those discrepancies would vanish since they’re not the focus of the video. If you took more time you could remove any of the discrepancies by adding more detail or maps where needed.

Try going through this tutorial 2-3 times (not in a row) to get familiar with the process. Then try it on one of your own photos. After this, you should be comfortable enough to do it quite efficiently. The image and scene for this tutorial took only 15 minutes to create (creating the Photoshop images for textures and setting the scene from start to finish) which gives you quite the bang for the buck!
 

DOWNLOAD SAMPLES FILES

You must be logged in to post a comment. Login here.
Hello there, I know this tutorial is already 11 years old, is their by a chance that the download sample files still exists in your server? its already a dead link. Thanks a lot neoaquino

About this article

This is a powerful technique to create engaging animations from static stills or context shots. This technique is widely used in cinematic productions to bring life to a static camera shot, or matte painting, by creating the illusion that one is traveling within a 3-D environment when in fact it is only a digitally enhanced 2-D image.

visibility34.3 k
favorite_border2
mode_comment1
Report Abuse

About the author

Jeff Mottle

Founder at CGarchitect

placeCalgary, CA