1 Tutorials LightWave 3D Animation Basics: Making Objects Follow a Path Qua Jan 26, 2011 2:18 am
Admin
Admin
by Policarpo, Visual Designer |
During Siggraph, I had a guy walk up to me after I got down from the Main Stage at the Newtek Booth and he wanted to know how he could set up a sort of train animation, or "roller coaster" type of animation in LightWave®. Being the non technical animation and purely still image print geek that I am, I told him that I wasn't sure how to do it. You see, I'm not an animator. I'm a lover. Anyway, I pointed him to someone who I thought might be able to help, but the problem he posed to me nagged at me, so I spent a little time testing out a few things, and guess what...if that guy were to walk up to me today I could give him the basic knowledge he would need to set up his animation. It might not be the only way to do it, but it worked for me so I thought I'd share what I discovered on my own. Okay, let's open up Modeler and create a Spline Path using the "Spline Draw" tool located under the CREATE tab. Make any shape that you want...it's your "roller coaster". It's easiest to create your motion path in the Top view as illustrated just to the right over there. Go crazy! Now let's add some chaos to the perfect path we've created in the Top View. With the "Spline Draw" tool still active, manipulate the vertices (the round green thingies) and create something that would make the strongest of us sick. We now have to create some objects which will follow this path. Create this on Layer 2, and let's just make it a very simple box...this is a proof of concept now isn't it? I chose to make my box 500mm square, but depending on the scale of your scene, you may need to tweak the size of your boxes so they are properly sized in relation to the overall size of your motion path. Be sure to bring up your Numeric Box Tool Window (hit "n" after you activate the Box Tool) and speicify the exact size and position the box at 0,0,0. Try not to make the boxes too large or too small, or else things will look really awkward once we start animating things. Cool. Now, copy that lovely little box you made and paste it into Layer 3, and Layer 4. You can quickly access the layers by either clicking on them or hitting the numerical keys located at the top of your keyboard...not the numbers on your numeric pad (that's reserved for some quick viewport actions that I'll write about soon). Here's a snapshot of how my setup looks. The three boxes are all located in the same exact position in space, so that's why we only see 1 box, and the 1 path we created. Don't worry, it will all become clear in a couple of minutes. ® So we're this far along, so go ahead and save your scene and name it whatever suits you. Let's bounce our assets over to Layout by selecting the drop down just to the right of the layer icons. Make sure all of your layers are selected (Shift Click to select additional layers). Select "Send Object to Layout". With me so far? Groovy. So now we're in Layout, but where the hell is our Spline Curve we created? Here's a quick fix to make it visible to us. Open up your Scene Editor (CTRL F1 for you shortcut freaks) and select Layer 1, which is our spline path. it the letter "p" to bring up the "Object Properties" window. From the drop down called "Add Custom Object" under the Geometry Tab, Select "ShowCurve" from the list of items. Depending on your monitor resolution you may need to scroll down to the bottom of the list to select this item. "Show Curve" should now appear in the list of Custom Objects field. Double Click on this item. Tada! The curve now appears in our Layout Viewport. Double click on Show Curve now. A nifty little box appears which lets us change some of the properties of our now visible spline curve in our layout Viewport. I chose green for my spline and Orange for my points. Pick whatever colors you find particularly helpful to your scene. Now let's assign those simple little boxes to our spline path. Select Layer 2 and bring up it's "Motion Options" panel (just hit the "m" key to access it). Under the "Add Modifier" drop down select "CurveConstraint" from the list of items. Double click on the CurveConstraint item that appears in this area. This opens the panel for the Curve Constraint properties. Under the "Curve" drop down select "ObjectPathSetup:Layer1" from the list of items. This is telling Layout that the our box on Layer 2 will use our spline path to follow for our animation. We just have a few more steps to set up and we can see our happy little boxes following our path of terror! Click on the "align" check box to make it active. Set your "Start Time" to 0, and your "End Time" to 100. This tells Layout that our animation is going to be 100 frames long. "Let's do the same steps for Layer 3. The only change here is that we're going to tell Layout to start the animation for Layer 3 at "Start Time" 5 and make the "End Time" 105. This will insure that our second box follows our first box along our path. If you set it to 0 and 100, like our first box, it will just look wrong. Go ahead...see for yourself and hit Play. Not good huh? Just a few more things to do and we're home free. Select Layer 4 and assign it to our Layer1 curve as we did with the other 2 boxes. Set our last box "Start Time" to 10, and the "End Time" to 110. I know this might seem a little weird, but trust me...the animation will work! Okay, since we set up different Start and End times we need to tell Layout what frames we want to show in our animation preview. Just to the left and right of the timeline are entry fields where we'll set our values to 10 and 100 respectively (our preview animation will start at frame 10 and end at frame 100). This next step really isn't necessary, it's just kind of cool in my opinion. Select your "Camera" and bring up its Motion Options panel (the "m" key). Under the "Target Item" drop down let's select "ObjectPathSetup:Layer2" to be what our Camera will always look at. What this does is very simple. No matter where our camera might be in the scene, it will always be looking at this object. It is now our primary focus in the scene. Go ahead and move your camera around...and see if you can force it to look away. (note: be sure "Auto Key" is inactive, else you might create some unnecessary keyframes which could cause problems during the animation. Shift F1 toggles Auto Key on and off. But leave it on if you want to animate your camera as it targets Layer 2 and moves around over time in the animation). Well, that's it. Your basic setup for creating a "roller coaster" type animation. Hit that play button and watch it go. There's so much you can do with this simple setup. Tweak the position of your vertices on your spline by changing them in Modeler until you get the right type of path you need. Try creating a series of animations and use "Motion Mixer" to do some really cool cut scene effects. I hope this was helpful and insightful for you guys. Feel free to drop me a line to let me know what you thought of my tutorial. Keep pushing yourself to learn new things! -policarpo | visual designer download scene files: ZIP | SIT |