T u t o r i a l - Expressions Basics - 1 |
---|
Skill Level: Beginner
Hi. How ya doin'?
This is a basic introduction to the world of expressions. You
won't be doing anything very complicated here--we're just laying
the groundwork... testing the waters... warming up... slicing the
melon (OK, I just made up that last one).
Your mission:
Make an object move around and have the camera follow its Z
motion but not its rotations or X and Y motion.
This is useful for things like making the camera fly along next to
an airplane or car etc. It's not exciting, but it's
useful.
What you'll need:
A hammer, a pair of scissors, a regular sewing needle, 5 nails, and
a piece of blue cloth (cotton).
How to do it:
1) Put the hammer, scissors, sewing needle, nails and cloth in
a safe place in case someone ever needs them.
2) Load in Whole_Object.lwo from Objects\Tutorial_General\.
3)Create a Null object called Camera_Null, and parent the camera to it.
Create the null.
Parent the camera to it. (I moved them to the top of the list
here.)
4) Select Whole_Object.lwo and click on the Z on the Edit Sphere (you'll see why in a moment), then go to the Command tab.
Select the Z channel.
5) Click on New Variable.
6) On the Expressions block, right-click on the little button to the right of the text entry field for Buffer. That will put this into the current expression: [Whole_Object:zpos]
After you right-click, you'll see this appear.
And this.
7) On the Channels block, select Camera_Null from the Add pulldown and press the [+] button.
8)Use the channel pulldown to select zpos.
The expression list now looks like this, with the expression name, the expression, and the channels it's modifying:
9)Animate the ball moving along all three axes, X, Y and Z. As you do, you'll see that the CameraNullobject will follow along on Z. When you press play now, you'll see that the CameraNulland the Camerawill follow the ball but only use its Z position.
The Camerahas been
pulled back along Z (from its parent, the Camera_Null).
The Camera has
been pulled back, and the Camera_Null is rotating.
So, all of the Camera and Camera_Null's channels can be animated, and it will follow along with the ball's Z position.
You can now add things to the expression if you want. For example, if you select the expression and add *2to the end of it, it will multiply the ball's z position by 2 before it adds it to the Camera_Null. The expression would now look like this: [Whole_Object:zpos]*2 It will make the camera catch up and pass the ball. Or, if you put in -5instead of *2, it will take the ball's Z position and subtract 5 meters from it, then apply that to the Camera_Null.
The part that makes you feel
good:
As you can see, expressions can be pretty basic and simple.
Of course they can be big and complicated too, but if you play
around with the basics for a while, you'll start to understand the
building blocks that lead to bigger and better things.
Note:In the scene file on the CD, I rotated the Camera_Nullduring the shot, so the camera moves around the ball (as in the lower animation, above). The scene is called Expressions_1_CameraFollow_01.fxs and it's in the Scenes\Tutorials folder.
Converted from CHM to HTML with chm2web Pro 2.82 (unicode) |