Camera Projection Mapping is the process of projecting an image onto simple geometry creating the illusion of detail and movement from what is really just a still image. This method has been used by many matte painters in the film and television industries. Camera projection mapping is a very handy technique to learn, but it can also be quite difficult to master. This tutorial will demonstrate how to create a Motion Design clip using camera projection mapping.
Final Effect Preview
Open a new scene in Maya. Under the Create menu go to Cameras > Camera. This will create a new camera in your scene, that will be used to project the image onto the geometry.
With the new camera selected, go to the channel box, double click on the camera’s name camera 1, and change the name to Proj_cam.
Translate (move) the camera towards the end of the grid on the Z axis. Then with Proj cam selected go to Panels > Look Through Selected.
In the viewport go to View > Camera Settings > Resolution Gate.
Change the resolution size of the final output from the default 640 X 480 by going to the rendering shelf and clicking on the render settings button. Under the Image Size tab change the Width to 864, and the Height to 486.
In this step you will import the image that you will be projecting onto geometry. In the viewport go to View > Image Plane > Import Image. Then select your image. Press Ctrl + A to bring up the image attributes.
Check the radio button ’looking through camera.’
Scroll down to the Placement tab, under the Fit dropdown menu select Fill and then click Fit to Resolution Gate.
Go to Create > Polygon > Cube to create a cube. Turning off interactive creation may help at this point.
Translate, scale and rotate the cube and the camera until the cube is lined up roughly with your image.
Right click on the model, and then select vertices in the mark up menu. Translate the vertices until it fits the middle building in the photo more accurately.
Press ctrl +D with the cube selected to duplicate it. Do this twice, and scale the blocks until they resemble the buildings on either side of the main tower in the photo.
The next step is to create a plain to receive the projection of the background. Go to Create > Polygon Primitives > Plain. Rotate and scale the plain until it is behind the buildings you have modeled.
Add a shader by going to Window > Rendering Editors > Hypershade. This will bring up the Hypershade window.
Click on the Lambert icon under the Create Maya nodes > Surface tab. This will add a new Lambert material to the Hypershades work area. Select the shader, and press ctrl + A to open up the material Attributes editor.
Change the name of the Lambert shader to Projection and click on the checkered box next to the Colour material attribute. This will open up the Create Render Node window.
Select the As projection radio button and then click on the File icon.
Under the Projection Attributes window, select Perspective as the Proj Type. Under the Camera Projection Attributes tab, select Proj_camshape under the Link To Camera drop down menu, and set Fit Type to Match Camera Resolution. Click the button next to the Image attribute.
Load a projected image of your choosing into the scene.
Select the Proj_cam and press ctrl +D to duplicate it. Call the new camera Render cam. Under the Rendering tab, click Render > Render Current Frame for a test render. Press the Keep Image button in the render window.
Select the Render cam and press S on the keyboard to set a key frame. Move to frame 200, and then rotate the camera to a slightly different angle. Render again. This way you can see if the projection is working by moving the slider back and forth in the render window.
Go to Create > Text > ? to bring up the text curve options. In the Text window, type Urban, and choose any font that you want by clicking on the downward arrow. Select Poly as the Type, and then click Create.
With the text selected, go to Mesh > Combine.
Right click on the text, pull the curser down to Face and select all of the faces.
Click on Edit Mesh > Extrude, and make sure the Keep Faces Together option is turned on. Pull the faces outward to give the text some thickness.
Repeat the previous steps to create the word ‘Motion’. Reduce its size by toggling the scale attributes.
Go to Create > Polygon Primitive > Cylinder. To change the cylinder to a hexagon, change the Subdivisions Axis to 6. Reduce the Scale on the Y axis to flatten the hexagon. Change the name to 'Hex', and then press ctrl + D three times so that there are four different hexagons.
Select the text, and all four hexagons, and group them together by pressing ctrl + G. Name it 'Urban_group', and move it to a suitable place in front of the camera.
Select ‘Urban’ and press the insert key on your keyboard. This allows you to move the pivot point of your manipulator and will come in handy when you are animating. Move the manipulator to the left of the text closer to the building and then press insert again.
With ‘Urban’ still selected, go to frame 120 and press S on the keyboard to create a key frame. Move the slider back to frame 100, and then scale ‘Urban’ down on the X, Y, and Z, axis down to 0.
Select the largest hexagon, and move the manipulator as you have in the previous step. Go to frame 130 and press S. Repeat the previous step with the largest hexagonal object (this should be named 'hex'). Now move to frame 120, and scale down to 0 on the X,Y,Z. You can also add a random rotation if you like.
Select the word, ‘Motion’ and move the manipulator to the bottom of the word. Go to frame 150, and press S, then go back to frame 130, and rotate on the X axis by about 360 degrees and scale all of the axes to 0.
Animate the remaining hexagons using the same methods. Set the pivot point manipulators within the object that you want it to appear out of in 10 frame increments. For example set the pivot point of ‘Hex 1’ into ‘Hex’ scale to 0. ‘Hex 2’ into ‘Hex 1’ and so on.
Open the Hypershade window again. Create a new Phong material, and name this material ‘marble'. Turn Ambient Colour and Incandescence all the way down, but turn Transparency up. Add a marble patterned source image to the Colour node, making sure the radial button on the Source render node is no longer on As Projection, and is instead set to Normal.
Repeat the previous steps twice, but add two separate source images to the Phong materials so that you have three new materials. Name the new materials ’ Urban_shader’, and ‘motion_shader.’ Apply the marble shader to the hexagon objects, the ‘Urban shader to Urban’, and the ‘Motion Shader’ to ‘Motion.’
Select all of the objects in the scene, then go to the Render layer editor and create a new layer. Assign the objects to it by pressing on the button on the bottom right of the Render editor. By double clicking on the new layer you can rename it. Change the name of the layer to ‘Master’ and then click, Save.
Create three new layers, and add all of the objects in the scene to each of them. Rename these layers, ‘Occlusion,’ ‘Specular,’ and ‘Reflection’. Right click on the 'Occlusion' layer to access the preset menu, and select Occlusion.
You will need to create a shader to add to the objects in the ‘Specular’ layer. Do this by creating a new Phong material, and call it Spec_shader. Turn the slider down on the Colour, Transparency, Ambient Colour, Incandescence, and Diffuse options. Turn the Specular Colour to white, and the Cosine Power to 45. Go to the 'Specular' layer, and apply this shader to all of the objects therein.
Press ctrl + D to duplicate the 'Specular' shader that you have just created, and name it 'Reflect_shader'. Turn the Reflectivity slider up all the way to the maximum value of 1. Assign this shader to all of the objects in the 'Reflect' layer.
Now you need an environment for the shader to reflect. Go to Create > Polygon Primatives > Sphere. Scale it up to 18.562 on the x,y, and z axes. Assign a new Lambert shader to the sphere, click on the Colour node, and choose the same image that you are projecting as the source image.
You only want the textured sphere to be shown in reflections, so what you will need to do is select the sphere, and press ctrl + A to bring up the objects Attributes editor. Under the Render Stats tab, deselect the Primary Visibility checkbox.
Do a test render of the reflection layer.
Open up the Render Settings window again. Under the Common tab, make sure the Frame/Animation ext is set to name.#ext. The Image Format should be set to PNG, and the End frame should be set to 200. Renderable Camera should be set to render_cam. Go to the mental ray tab and set the Quality preset to Production. Make sure that all render layers apart from the default MASTERLAYER are checked. Finally, make note of where the rendered files will be saved to (they are normally saved in the image directory).
Under the Rendering menu set, click on Render > Batch Render. Wait until the render is complete and then go to After Effects for the compositing stage.
Open up After Effects then go to File > Import > File.
Navigate until you find the folders that have been named after your render layers. Open ‘Master’, and click on the first file in the sequence. Make sure the PNG Sequence tickbox is selected, and then click Open. This will import the entire rendered image sequence. Do this with all of the other layers that you rendered out from Maya.
By dragging one of the imported image sequences onto the new composition button, the comp inherits the image size and length of the footage that you have imported. All of the other layers can now be dragged onto the timeline.
By clicking on Toggle Switches/Modes at the bottom of the window, you can see different transfer modes. Make sure the 'Ambient Occlusion' layer is set to Multiply, and is above the 'Master' layer. The 'Reflect' layer should be set to Overlay, and the 'Specular' layer should be set to Screen. 'Specular' should be the top layer, and 'Reflect' should be second from the top.
To add a slight haze, create a new Adjustment Layer. Set the transfer mode of this layer to Add, and adjust its opacity as you see fit.
That's it! Hope you learned something new here!!
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post