上QQ阅读APP看书,第一时间看更新
Spinning and throwing a ball
This recipe continues our exploration of Motion behaviors.
How to do it...
- Double-click to open the
03_03
project. This project consists of an AquaBall still image. This is taken right from Motion's Library. - With the AquaBall selected, go to the gear icon and choose Throw from under Basic Motion as shown in the following screenshot. Press the F7 key to reveal the HUD.
- Press the Space bar to play back the project. Nothing happens. In the HUD, we need to determine where we want the ball to go. Click and drag the center cross hair to the right-hand side until you see an arrow. Drag it till it touches the outermost edge of the circle. If the circle isn't moving fast enough to go offscreen, drag the zoom parameter to the right and than drag the arrow further to the right as shown in the following screenshot:
- Stop the playback. Make sure you're on the first frame of your project. Decrease the Canvas size by pressing the Command + - shortcut. Select AquaBall in the Canvas and drag it until it's offscreen to the left-hand side. The ball now travels from offscreen left to offscreen right. If it's not, select the Throw behavior and try adjusting the zoom value in the HUD followed by the arrow.
- Click on the i icon to go to the Inspector. Click on the disclosure triangle next to Throw Velocity. Adjust the x value to 250. Press the Space bar to play back.
- Let's reset the Throw behavior and throw the ball so it looks like it's falling away from us. Click the hooked arrow on the top-right corner of the Behaviors tab as shown in the following screenshot. Click on the Properties tab and set Position to
0,0
and Scale to400
. - In the HUD, change the 2D tab to 3D. Click and drag in the center to get an arrow. Drag the arrow so that it faces away from you, as shown in the following screenshot:
- In the Inspector, change the value of Throw Velocity of z to -3000. Play back your project. The ball is now thrown back in space. With the ball selected, in the Layers tab, go to the gear icon and choose Spin from Basic Motion. Press the F2 key to go to the Behaviors tab. Under Spin, change the Axis to y and set the Spin Rate to 9 degrees. Finally, adjust the middle circle in the HUD display as you see fit. Pay attention to the changes that take place in the Behaviors tab, as shown in the following screenshot:
There's more...
The Throw behavior is a great introduction to the complex and never-ending world of 3D in Motion!
Z space and 3D
Through our simple change on Throw Velocity, we have started with the most basic introductions to the world of 3D. While x is left and right and y is up and down, z denotes depth. The further back an item is, the smaller the number it will be on z. That's why when we threw our ball -3000 pixels back it became really small.
See also
- This Applying a Fade In/Fade Out and Grow/Shrink behavior to a still recipe
- This Customizing a Motion Path recipe