Camera Projection Fun


Here, for fun, is a short tutorial on how to turn a 2D photograph into a 3D animation using Maya camera mapping. The move you see is entirely virtual. This technique forms a useful basis for "view-dependent texturing" of foreground objects, as well as for imposing a 3D move on a 2D matte painting background.

UPDATE 4/18/2009: The high res photos are on flickr for you to play with.

Here's a simple photo of a cardboard box sitting on the floor. (hi res version on flickr)

Here's a "clean plate" of the floor alone. I retouched it a bit in Photoshop to let a little of the original box remain around the base. This little trick lets me be a little sloppy in alignment later on. (hi res version on flickr)

Using measurents from a ruler, I match model a virtual box with the same proportions. I don't sweat the details (like the folded cardboard flaps on top) - I keep it simple.

I create camera 1 and position it so that the 3D wireframe box I modelled lines up with the photograph of the box.

I create a second camera -- camera 2 -- and match it precisely to camera one by editing its attributes, and by using point- and aim-constraints.

I use "perspective projection" from camera 2 to project the image of the box onto the virtual box. I use the same camera to project the "clean floor" plate onto a matched position virtual floor object.

To eliminate blurry mapping artifacts on the box, I found I had to turn off filtering in the file node.

The trick of this project is to decouple camera 1 from camera 2 -- to break the constraints so that the projecting camera and the rendering camera are no longer in the same place.

Notice how my original box photo shows three sides visible on the box. When designing my animation, I purposely chose an initial position that hid one of the three box sides, and revealed it over the course of the move. The reveal of the third side makes for a fun, unexpected surprise.

I first started using camera mapping in in the Eighties, although the technique itself was already well-known to some in the CG world before then. The concept of camera projection is older than CG itself, and was used to great effect in analog form in the theater world for decades.

When the photograph matches the foreground object, and when the projection can be made to "stick" to the object while the object flexes (through reference objects, or projection of UV's into vertices) then camera projection can be used as the basis for creating view-dependent texture maps.

When the photograph matches the background, it can be used to impose a 3D move on a 2D matte painting.


(click image above for a closer look)

When the photograph contains an object with no matching 3D geometry, (as it does in this test I tried in 1992) the photographic object can appear normal when viewed from one place, and "painted on the wall" or "cast like a shadow" when viewed from another place.

Conversely, when a 3D object exists but is not represented in the photograph, the 3D object can, when viewed from the right place, vanish like a chameleon into the background. Look at the character "Reptile" in the movie Mortal Kombat, to see this technique in action.

UPDATE 1/16/2006
Here are some fun "real world" examples of the principles of camera projection in action:

Felice Varini: Denial of Perspective

Kurt Wenner: Amazing Sidewalk Chalk Artist

UPDATE 7/10/2009

I recently noticed that back in 2006 Miltos Pilalitos used camera projection to good effect on his zero-budget anti-war PSA.


is this maya what is being used?

I'm using Maya 6, but any version of Maya will do, as far as I know -- and although the workflow will differ, the principles hold true in any 3D package that has implemented the idea of camera projection -- which is really nothing more than projection using rays which all radiate from a single discrete 3D point.

i appreciate this tutorial as it is something i've been having problems with. is it possible to email you (i can't seem to find any contact information on this site)? i have a question about a particular situation where camera projection might be used, and i thought perhaps you could steer me in the right direction. thank you.

I'm still learning how to handle a Movable Type-based blog, so at the moment there isn't too much information on the page that wasn't in the default layout.

You can reach me by email at jfrancis at earthlink dot net


I Like It!

Cool - cant quite get all the way though. I'm a little lost here. ok
francis you say - I use "perspective projection" from camera 2 to project the image of the box onto the virtual box." I cant see where it goes into the the camera projection setup for cam2. I've got the clean floor plate showing up fine - coming from the place2DTexture in the shader line up.

camera 1 is the rendering camera plus the one you animate?
camera 2 is the projecting camera?
is that right

sorry to be a pain in the butt!, I'm sure I'm missing something real obvious. any answers would be great

hi this is an excellent artical on camera projection. Theres some part I'm can't fully replicated your scene, for example

1. how did you match the camera1 with the real camera that your shot from(or did you not do it?)

2.was the box model a perfect box or did you tweek the vertex so to match the perspective distortion your see of the texture image viewed from camera1? (I can't seem match it)

I matched the wireframe to the photo only by eye.

The box is a true box.

You'll never get this image:
exactly as shown in your viewport. I pushed the box wireframe closer to the channel box so that you could see both at the same time. I also may have rolled the camera a bit. The unusual placement and perspective may make you think that I pulled a corner or two. I actually did not.

This is just a manipulation of the screengrab of the gui. The scene itself is quite straightforward.

I was able to follow the tutorial, except I was initially unclear as to actually setup the projection. You're other tutorial on the same subject cleared it up. Also, just duplicating the camera seems to work just fine for me, instead of going through the process of constraining and unconstraining.

You're right. Duplicating the camera does work well, and when this sort of thing comes up, I do it all the time that way now.

I'm not sure why I didn't always do it that way, but there you go. For whatever reason it didn't occur to me.

looks like alot of fun but..

where is the perspective projection button? what needs to be selected when i click it? how do i find the point/aim constraint buttons and use them to match up the cameras? how do i decouple the two cameras afterwards, and why do they need to be matched up in the first place? what would happen if i tried to view the box from behind? would it just be untextured?

I actually work on a movie where we use extensively the camera mapping method. So I tried to make it work with maya and mental ray (as we do not use maya, but mental Ray), but the projection is non working when rendering with MR (we get a kind of hjdkfqlr zfc,hufize...)

maybe someone got an idea to make MR understand the projection node ?

Hi, I recently played around with camera projections for the first time.

I was wondering if you could give some pointers on using it for modeling purposes as well.

I tried using a photo I found on the web to model a house and use the same image as a camera projected texture and it worked out pretty good. So I tried the same thing on more random photos from the web and had absolutely no luck.

I've made a post about it over on cgsociety. Photogrammetry Thread

I just went through the tutorial and it was a big help to me. (see my results here; 'projection1' )

Thanks again:)

I just watched your video; very nice job

hi ,dear
can u give more camera mapping tutes ...

i was looking for the Poser/Bryce import/export in Maya but ended here.Now am stuck here with all the fantabulous magnifique and some very bizarre collection of curious and rareties (e.g The Photoshop section with filters fx results -cool).
Being a Maya student I really am hooked onto to you.And am a leech for infotainment providers like you.So I've clawed into the 3 usb ports on the back of your neck(read:Ghost In The Shell's Matako).If you hear whispers in your head,then its probably me.
PS-you may find my post obscure and meaningless but if you can comprehend them then you too can find the secrets of I-Ching hexagrams .

i hate to say it but this tutorial is a bit of a piece of crap.

as a few others have pointed out, there is quite a big step left out here.


please provide more information than just a screen grab of the hypershade w/o any of the connections displayed.


Dear crap,

You are probably right. I hate slow tuts and pitch mine at a fairly rapid pace sometimes.

I might expand on this old thing from 2004, but then again I might not. Seeing as it's nearly 2010 now, you can probably find a better one online by now.

Hey Dear ,
Really great knowledge you have given , I was searching since long for such kind tutorial to teach my students, Thanks alot.

Moin Attarwale, Pune,INDIA

Good and informative article. This really helps me a lot. Nice sharing of projections. Thanks. keep blogging.

About this Entry

This page contains a single entry by published on November 15, 2004 12:10 AM.

Anatomy Practice: Shoulder Girdle was the previous entry in this blog.

ColorTalk is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.