Cameras

table of contents

Cameras

In Maya, every view relates to a camera. When Maya starts, you have four cameras by default: front, side, top, and perspective. Three of them are orthographicflat, non-perspective viewsand have visible icons you can use to translate or rotate the camera. The icon for the perspective camera is, by default, invisible. These four cameras are utility views that assist you in modeling and laying out your scene. When you're ready to pick the final rendered viewpoint of your scene, you should create a scene camera. If you're shooting a series of stills, you can create many cameras, one for each shot. (However, often it's easier to move a single camera to different positions in sequential frames , starting with frame 1, so that you can render the job more easily in batch rendering.) Or you might have several animated cameras that fly through the scene from varying angles, creating several different video clips of the same scene that are rendered separately.

The camera placement determines exactly what will be seen and is used to frame specific portions of the scene, in the same way artists use composition to frame certain elements in their paintings and drawings. Other key variables for cameras are focal length, rotation (orientation), and angle of view. Focal length is directly linked to angle of view; if one goes up, the other goes down. With angle of view, as the angle of the lens widens, you must move the camera closer to the subject to keep it at the same relative size in the frame. The wider the angle, the higher the value for the Angle of View setting. Figure 12.1 illustrates four settings for Angle of View.

Figure 12.1. Clockwise from top left: a wide-angle (90 degree) close-up view, a normal (55 degree) view, an orthographic (0 degree) view, and a zoom (17 degree) view.

graphics/12fig01.gif

Creating Cameras

There are three types of perspective cameras in Maya, shown in Figure 12.2. Like the lights, you can change a camera to any other camera type in the Attribute Editor.

  • Camera With this camera type, you see only the camera icon (the next two types add manipulator handles to the camera icon). In general, because this camera freely rotates and loses track of its "up" vector (as shown in the rotating camera at far right in Figure 12.2), you should use it only when you're linking the camera to another object for movement and animation (as in the boat tutorial in Chapter 4, "Diving in: Your First Animation"), or when you're placing a camera in one fixed spot.

  • Camera and Aim This camera includes a camera target (in other words, what the camera is looking at) as well as an aim handle for adjusting the camera target. In addition, this camera automatically stays level in relation to the horizon, so it's the one you'll use most often. You can make this camera roll if you want, but by default it stays level except at extreme straight-up or straight-down orientations.

  • Camera, Aim, and Up This camera type includes two handles: the aim handle, described for Camera and Aim, and an up handle for banking (leveling) the camera. This camera type is useful when you want to bank the camera during your animation. Note that you must select both the camera and the up handle when you move the camera, or the up handle will remain in place as you move the camera, causing unwanted banking.

Figure 12.2. The three camera types, left to right: Camera; Camera and Aim; and Camera, Aim, and Up. To rotate cameras, click in the blue circle shown at the right.

graphics/12fig02.gif

tip

When Maya starts, you see a Perspective view with its own default "persp" camera. This Perspective view is useful for navigating around your scene to find the areas you want to focus on and to edit those areas in 3D. You can create additional cameras and use them for "official" render cameras or as additional test perspective cameras like the default perspective camera. Usually, however, it's better not to use the default perspective camera as your scene's render camera because it's too easy to unintentionally move or alter.


Camera Settings

With a camera selected, you can open the Attribute Editor and expand the Camera Attributes section to see all the variables for the camera, as shown in Figure 12.3.

Figure 12.3. The attributes for cameras.

graphics/12fig03.gif

These are the key settings for cameras under the Camera Attributes section:

  • Controls In this drop-down list, you can quickly select the camera type you want.

  • Angle of View/Focal Length Controls the amount of perspective exaggeration. Raising the Angle of View attribute lowers the Focal Length attribute. For example, in Figure 12.1's top-left image, the angle of view has been raised to 90 degrees, so the focal length is shortened to 18, thus producing a close-up view with heightened foreshortening, most noticable in the distorted torus .

  • Camera Scale You can change the camera size in relation to your scene, which affects the scene objects when you render. Camera Scale is like a multiplier for the Angle of View. For example, decreasing the Camera Scale attribute to .5 halves the camera's view area, but makes the objects in the scene appear twice as large.

  • Clip Planes Only objects located within the values specified for the camera's clip planes appear in the scene. If distant objects are not appearing, raise the Far Clip Plane value. If nearby objects seem to be appearing in cross-section or not appearing at all, lower the Near Clip Plane value.

  • Depth of Field Enable distance blur with this attribute. It can be a render- intensive effect, but yields a more realistic result because objects close to and far from the focus point are progressively blurred.

  • Background Color The background fill color for images rendered from this camera; you can also use this section of the Attribute Editor to add an image or shader as the background.

  • Orthographic Views Switches the camera to an orthographic view (such as Side, Top, or Front), which has no perspective. You can create perspective cameras, rotate them into position, and then set them to orthographic to get a "flat" view for projecting textures onto an object.

tip

The Film Offset settings are helpful for architectural animators who want to avoid vertical perspective distortion. If you have set your camera to a view that causes vertical distortion (refer back to Chapter 1, "Pre-Maya: A Primer," and take another look at the rightmost image in Figure 1.10), you can adjust these values to get rid of the distortion. First, you must raise or lower the camera itself, so that it is horizontal; this removes all vertical distortion. Then use the offset settings to frame the portion of the image you want to render. The Film Offset X and Y values (X is the left text box; Y is the right) reposition where the camera "looks" in relation to the target.


Animating the Camera

When you animate the camera, you need to follow the rules of videography, such as avoiding jarring camera motions rapid pans, zooms, or rotations of the camera. In addition, you'll usually want to give the camera the impression of having mass. The virtual camera, by default, starts and stops moving instantly, which looks unrealistic and abrupt to the viewer. To avoid this problem, adjust the tangents for the camera position start and stop keys in the Graph Editor so that motion begins and ends gradually (refer to Chapter 10, "Animation Basics," for more information on adjusting tangents). Do the same for the camera's aim point keys and any other animated camera attributes if you want to get a smooth look. Of course, if you're after the "reality TV" look, you'll have no problem creating a shaky, off-kilter camera in Maya. It's the "cinematic" look that takes some work. You'll explore smoothing the camera's action in the next tutorial.

tip

You can make a panel "look through" any scene element (object, camera, light, and so forth). Choose Panels Look Through Selected on the panel's menu bar, and the panel will switch to the viewpoint of the currently selected scene element. Most of the time, you do this only to check the aim of Spot and Directional lights, but this method can also be helpful when you want a quick look at the scene from an object's point of view. For objects, if you look through them, you're viewing from the object's local Z axis.


Tutorial: Easing the Camera's Motion

In this tutorial, you'll animate a camera and then adjust its animation keys for smooth motion. You want the camera to swing left around the objects, then move left across the cylinder, cone, and torus, and finally rotate to the far side, behind the tall box object. After you set the position keys for the camera and its target, you'll give the camera the appearance of mass by adjusting the tangents for the camera and the target's start and stop keys so that the transitions in motion are more gradual.

  1. Make sure you're in Four View mode (if not, tap the spacebar to switch). Create a camera (Create Cameras Camera and Aim). In the Channel Box, set Translate X, Y, and Z to 150 , 40 , and 9 . Set Scale X, Y, and Z to 20 so that the camera icon is bigger and easier to select. With the camera still selected, activate the Perspective view, and choose Panels Look Through Selected. Your shaded view is now the camera's view; as you move the camera, you'll see the shaded view update. Open the Outliner, expand the Camera1_group, and select the camera's aim point, named camera1_view. Set its Translate X, Y, and Z to 50 , 11 , and 8 in the Channel Box.

    graphics/ch12_icon.gif graphics/ch12a_icon.gif
  2. Click the down arrow to the left of the Select by Object/Component Type (selection mask) buttons , and select All Objects Off, as shown in Figure 12.4. RMB-click on the Rendering selection mask button (the blue sphere), and choose Cameras. Now you can select only cameras in your scene, which will make the animation process easier.

    Figure 12.4. Using the selection mask buttons.

    graphics/12fig04.gif

  3. Select Camera1, and then Shift-click on the aim point to select its targetcamera1_view. In the Time Slider, confirm that the current frame is set to 0, and set an animation key for just the Translate values (hotkey: Shift+W ). Deselect he camera and target by clicking in a blank area of the Camera1 view the Perspective view).

    tip

    Normally, you set keys by using the s hotkey, but you can also use Shift+W, Shift+E, and Shift+R to set keys for Translate, Rotate, and Scale without affecting other keys. By default, the s hotkey sets keys on all the attributes, which isn't usually what you want. Adding keys to elements that aren't animated can cause a lot of trouble if you decide later that you do want to animate those attributes.

  4. Drag the Time Slider to frame 60. Switch to Move mode (hotkey: w ). In the Top view, select the camera, and move it down and to the left, so that Translate X is roughly 138 and Translate Z is about 55 (the Channel Box will reflect the camera's current position as you move it).

  5. Next, you'll set a key but change the defaults so that the s hotkey works only for the current manipulator typein this case, the Translate values because you're in Move mode. To do this, choose Hotbox Animate Set Key option box. Change the Set Keys On radio button to Current Manipulator Handle, and then click the Set Key button. From now on, the s hotkey will create keys only for the current manipulator. Select camera1_view (the target), and move it slightly down and left so that it's on the cone object, and set its Translate key for frame 60 (hotkey: s ). The Translate fields in the Channel Box turn orange to indicate that keys have been created for the selected object.

  6. Drag the Time Slider to frame 120. Shift-click the aim handle to select both camera and target. In the Top view, move them together down and to the left so that the camera target is at the center of the torus. Set a key by pressing s (which will set a key for the Translate values of both the camera and target). Next, select only the camera and adjust it so that it's closer to the torus in the Top view. In the Front view, bring the camera's height down somewhat (until Translate Y is about 25 ). Set a key again (hotkey: s ) to overwrite the camera's previous key.

    tip

    You can overwrite previously set keys by setting a new key for the same attribute on a frame that currently has a key.

  7. Drag the Time Slider to frame 180. In the Top view, move the camera down to a position that's about 25 and 90 for Translate X and Z; the sight line to the target will be vertical. Check the Camera1 view and adjust the camera's position if you want it slightly closer or farther to the objects in the scene. Set a key for the camera, and then select the target and set a key for it, too.

  8. With the target still selected, drag the Time Slider to frame 210, and set a key. Select the camera and move it a few degrees to the left of the torus (Translate X, ; Translate Z, 90 ). Set a key.

  9. Drag the Time Slider to 300. Select both camera and target. In the Top view, position the camera target at the center of the tall box by dragging the aim handle, and set a key; both will be keyed on the Translate values because both are selected and you're in Move mode. Next, select only the camera by clicking in an empty area, and then clicking the camera. In the Top view, move the camera to the far left side of the tall box. Set a key again with the s hotkey to key the Translate values for the camera.

  10. Activate the shaded Camera1 view by RMB-clicking on it, and then click the Play button in the playback controls to the right of the Time Slider. Notice that the camera motion is fairly smooth, but it starts and stops abruptly.

  11. Make sure the camera is still selected, and view the camera trajectory by choosing Hotbox Animate Create Motion Trail option box. In the Motion Trail Options dialog box (see Figure 12.5), select the Line radio button for the Draw Style option, deselect the Show Frame Numbers check box, and click the Create Motion Trail button. You can now see a line that illustrates the path of the camera. Do the same for the camera target. These paths, generated by the keys you set, can be helpful to visualize what you've animated, and they are updated as you adjust keys. To see these motion trails in action, try moving the camera after activating the AutoKey feature. After you release the mouse button, the curve will update. Press z to undo, and then deactivate AutoKey.

    Figure 12.5. Creating a motion trail for the animated camera.

    graphics/12fig05.gif

  12. Make sure the camera is selected. Open the Graph Editor (Hotbox Window Animation Editors Graph Editor). When it opens, you'll see lines representing the camera's motion curves. Click and drag over the three Translate labels in the Graph Editor Outliner. The graph changes to display just these three attributes. Now frame the view (hotkey: f ) so that the motion curves fill the Graph view.

  13. Marquee-select the leftmost points of the red, green, and blue motion curves in the Graph view. Hold down the Shift key and do the same for the rightmost points of each curve. RMB-click on one of the endpoints, and choose Tangents Flat, as shown in Figure 12.6. All the tangents become horizontal at their beginning and ending points.

    Figure 12.6. Editing the tangents of the curves' endpoints in the Graph Editor.

    graphics/12fig06.gif

  14. In the Graph Editor Outliner, scroll down to the bottom of the list and find the Center of Interest section. Select the three Translate entries in that section. The motion curves displayed in the Graph view will change. Repeat Step 11 to flatten the tangents for the beginning and ending points of these curves.

  15. Close the Graph Editor, RMB-click the Camera1 viewport to make it active, and play the animation (hotkey: Alt+v ). The moving camera's view should play back in a loop, and the starting and stopping action at the ends of the animation should occur much more smoothly. You can compare your final version with the finished scene file noted here, if you like.

    graphics/ch12b_icon.gif


Maya 4. 5 Fundamentals
Maya 4.5 Fundamentals
ISBN: 0735713278
EAN: 2147483647
Year: 2005
Pages: 201

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net