Spaceship Fly-Over In BLENDER This is my first ever attempt at doing a Blender tutorial. I’m going to try to show how to create a short looping animation of us flying close over a spaceship. Think Luke Skywalker flying over the Death Star. I’m going to do this tutorial in two parts. In the first part I’m going to try to go into a lot of detail in order to make it very “newbie” friendly. I’ll try to explain what I’m doing in enough detail so that hopefully most everyone will be able to follow along. Having said that, this isn’t meant for someone who is opening Blender for the first time, but I do hope that folks with very basic skills should be able to it. By the end of the first part, I think we should be able to have a very decent animation. In the second part I’m going to go into a few other things that are probably more geared toward an intermediate user. These will mostly be using compositing nodes to add some effects, that I think improve the animation quite a bit, but aren’t vital to its creation. I’m not going to go into quite as much detail in part 2 as to how to do something, other than to say what I’m doing, and a few screenshots to show the setups. Okay then, let’s get started!
Part 1 – Creating the animation. Open up Blender, delete the default cube and add a plane (spacebar, add, plane), and then scale it up 5x its original size. (S-key, 5, enter) Enter Edit mode and subdivide your plane 3 times. (Tab to enter edit mode, F9 for edit buttons, then click subdivide 3 times). Tab out of edit mode, and split your 3d screen about in half (move your cursor to the top of the 3d screen, where it borders the menu bar, until you see a double arrow, right click, and select “split area” and then left click, you can then “grab” this border and slide it to get the size you want), and then change one of the windows to a Scripts Window, (click the box at the bottom left of the 3d window, and then select the window type we want from the menu that shows up).
Make sure that your plane is selected in the 3d window, then in the script window, Select Scripts>Mesh>Discombobulator.
We’ll make these changes to the discombobulator defaults.
Now press the “Discombobulate” button at the bottom. The discombobulated mesh will magically appear in the 3d window. Move your cursor to the 3d window, your new mesh should be selected, make sure it is, and scale it down along the “Z” axis to 25% of its original height…(S-key, Z-key, .25, Enter) We won’t need to use the script anymore, but we will need that window. So what I do is slide the border on it over so that it is as small as it will go. With your discombobulated mesh selected, duplicate it and move it 10 blender units along the Y axis. (Shift+D, Y-key, 10, Enter). To make things simpler lets name our 2 discombobulated planes. I’ll name the original ship1 and the duplicated one ship2. (One way to name a mesh is to press the “N” key while your
cursor is over a 3d window, this will bring up the transform properties panel, and you can then type your new mesh name into the “OB” field. “OB” for object. You can also type in numbers directly into the location, rotation and scale fields directly.) It is important to have identical meshes here because we are making an animation that will loop, so the mesh in the view at the end of the animation has to exactly match the view at the very beginning. It is probably a good idea to save your work here. Now we need to set up the camera. I am creating this animation to use as an animated .gif that I can use as a signature on a forum, which causes quite a few limitations. We’ll get into a few more of these later. But since this is planned as a sig, I wanted it really wide, but not very tall, so let’s set the camera rendering size as 800x200. You can do that under the render windows (F10).
In my file, the mesh we named space1 is located at 0, 0, 0 coordinates, and space2 is located at 0, 10, 0. Make sure that yours matches this, so that the camera coordinates we are getting ready to use will work too. (You can use the “transform properties” panel to type in these exact coordinates if you need to.) We want to place the camera so that it is close to the “spaceship” and angled down a little so the sky doesn’t show up in any of the frames. This is to give the impression that this spaceship goes on forever. For me this works out for the camera to be at location 0, -6.5, .6, and a rotation of 80, 0, 0.
Like so:
With the cursor over the 3d window, and the animation at Frame 1, press the I-key and select “Loc” to insert a “location” key. Now change the animation frame to number 150. Move your camera to location 0, 3.5, .6, and insert another “location” keyframe. These locations need to be exact so that our animation will loop properly. (Instructions below on how to change the animation frame numbers.)
(On my default Blender setup, I like to keep a “Timeline” window below my 3D window. That makes it really easy to access specific frames in my animation, and to watch the animation. You can create a timeline window the same way we created the Scripts window, just split the screen horizontally instead of vertically, and then change the window type to “Timeline”.) Like so:
Alrighty now. We’ve got to adjust the IPO curves for the camera animation so that it moves at an even speed from start to finish. When you add keyframes in Blender, it defaults to a bezier curve path, which means that the movement will start slow, speed up in the middle, and then slow down towards the end. We need to change that so that it is a consistent speed from start to finish, or else our looping animation won’t flow smoothly. So to do that, take the window that we originally used to access the discombobulator script, drag it over to expand it so that it is about half the available space, and change it to an IPO Curve Editor window, the same way we changed it to a Scripts Window earlier. With the camera selected you can see the IPO curve in the IPO window, make sure your cursor is over the IPO window and press the A-key until all the curves are selected. Now press Tab to enter edit mode for your IPO curves. Press “A” until you are sure that all the curves are selected, and then press the “V” key. I don’t remember exactly what that stands for, but I know what it does, it makes all the bezier curves into straight lines, and that makes the camera move at a constant speed. Press tab to get out of edit mode in the IPO window, and now you can get rid of
that window. (Hover your cursor over the line dividing the two windows we made earlier, until you see the double arrow, right click, select “join areas”, then left click on the window you are getting rid of.) Now, our first and last keyframes for our camera are at frame 1, and frame 150, and they should look exactly the same in camera view, which will cause a little bit of a hiccup when we loop our animation, so we need to change the final frame of our animation so that it will stop at frame 149. You can change the ending frame number, either in the Timeline window, or under the “Animation” button in the Render buttons (F12). Make sure the start frame is “1” and the end frame is “149”.
Like I said earlier, I am planning this animation to be an animated .gif file to use as a forum sig. To do that I will host the image at a free image hosting site, and link it to the forum. Most image hosting sites have a file size limitation of 1.5mb. I’ve found that to get a decent balance between size and time, 5 seconds is about as long as I can make an animation without having to make it really, really small. So that’s why I’ve made it 149 frames long. Now would be a good time to save again. Okay, we need to add a material to the spaceship. I’m going to use a material that I’ve downloaded from the Blender Materials Repository. So go to the Blender Materials Repository website and download the material called “Starship_Hull”. (http://matrep.parastudios.de/index.php?action=view&material=321-starship-hull) I have a Folder called “Blender Materials” where I keep all my downloaded materials. Where ever you download the Starship_Hull.blend file to, you need to remember, so that you can go there to append that material. Do that by clicking “File” at the top left of the screen, choosing “Append or Link” from the menu, then navigate to the “Starship_hull.blend” file that you just downloaded and then to the materials. Click the material you’re going to append, in this case “star_ship_hull1”, and then click “Load Library”. Now with the “ship1” mesh selected go to the materials button window (F5), and select your starship hull material by accessing the dropdown menu in the “Links and Pipeline” button window. Now select the “ship2” mesh, and add the same material to it too.
A quick test render shows me that the texture for this material is being stretched too much, so, in “Texture” buttons (F6), change the X and Y repeat values to 5.
Okay, all we need now is to add some lights and render our animation. I’m not going to go into lighting very much, but I will show you how I’ve got mine set up. I’m sure there are probably a lot better ways to light this scene, but this is good enough for now. My basic light set up is one sun lamp and 2 hemi lamps, pointing basically in 3 different directions. (spacebar, add, lamp, and then the type of lamp you are adding.) Here are the positions and rotations of the lamps:
And here are the settings for the lights. (Both of the hemi lights have the same settings.) Sun Lamp:
Hemi Lamps:
Okay, that just about does it for part one of this tutorial. We could render our animation now and it wouldn’t look too bad, I think. At this point, all that’s left is to select the format you want your render output to be (Render Buttons (F10), format), and press the animate button. For my purposes as an animated .gif, I’ll use .jpg. I’m not going to get into how to create an animated .gif in this tutorial. That needs to be done in 2d graphics program, such as GIMP, Photoshop, PaintShop Pro, or something like that. If you do want to create a .gif, you’re on your own; although I’m sure a quick on-line search will turn up about a thousand and six tutorials on how to create one with the program of your choice. This is frame # 123 in my animation at this point.
Part II – Spruce it up, with AAO, DOF, and Vector Blur Okay, like I said in the beginning, I’m not going to go into a whole lot of detail in this part, but I will try to explain what I’m doing, just not as much on how I’m doing it. I’ll add some screenshots too. Now, lets spruce it up a little bit. AAO: I like to turn on AAO, or Approximated Ambient Occlusion, for most of my final renders. To me it just looks a little better. But, it also makes render times a whole bunch longer. And I mean a whole bunch longer. Three and half seconds without AAO, and forty-one seconds with AAO on an 800 x 200 render on my machine. So, on this 149 frame animation we’re talking 9 minutes versus over an hour and a half. (although, my final .gif, in order to be under 1.5mb, the size will likely be closer to 400x100, but still…) Is it worth it? Sometimes it will make all the difference in the world, sometimes, not so much. Run a test render each way and decide for yourself. First one is with AAO, second one is without.
If you decide you want to, I used these settings, pretty much the basic AAO settings.
DOF (Depth of Field) using nodes. I love DOF. I use it on just about everything I do. It probably really doesn’t even add that much to this particular animation, but I still love it. Change your 3d window to a Node Editor window, click “use nodes”, make sure you have compositing nodes selected instead of material nodes, and select “Backdrop”.
You should already have a “Render Layer” node, and a “Composite” node. You will need to add a “Map Value” Node (spacebar, add, vector, map value), a “Color Ramp” node (spacebar, add, convertor, colorramp), a “Blur” node (spacebar, add, filter, blur), and a “Viewer” node (spacebar, add, output, viewer). Okay, I could spend the next 3 hours and 20 pages trying to describe how they all plug into each other, or I could do a screen print.
I’ll do the screen print.
I’ve turned off the backdrop and arranged the nodes to make it easier to see how everything goes I hope. Basically, the way this works, as well as I understand it (which is really not too much), is the Map Value node takes the “Z” value, or distance away from the camera and using the ColorRamp node represents this as a grayscale image. The Blur Node then uses this grayscale image to apply a blur to the rendered image. If you take the image output on the ColorRamp node and plug it into the “View Node” image input, and turn on the backdrop you can see what I mean. To get it to render you push the little “Render” button at the bottom left of the “Render Layers” node.
The way it works is, everywhere that it is black gets no blur at all, and everywhere that is white gets the full blur as designated in the “Blur” node. I’ve got the blur set as “Gauss” with a level of 4 both X and Y. The higher the number, the greater the blur. The gray areas get a gradient value of the blur. Here’s a render result. (BTW, don’t forget to turn on the “do composite” button in the Render buttons panel under animation so that Blender knows to use your nodes when you push the Render button:
I wanted to show and explain all this because you can use this same node setup to create DOF blurring in any Blender file by tweaking the numbers in the Map Value node. The Offs field represents how far away from the camera we’re dealing with, and the Size field adjusts how wide the gradient effect of the blur will be. Sliding the Color Ramp sliders can help you to fine tune what you’re doing, or even reverse it so that objects close to the camera are out of focus, and things far away are in focus.
Like so:
Result:
Or, you can add sliders to the ColorRamp node and make it so that what’s close and what’s far away are blurred and what’s between that is in focus:
Result:
Okay, enough with the DOF already, lets move on to the last step, which is Vector Blurring.
Since we are flying over a spaceship at an insanely high rate of speed, we should expect that the scenery would be going by so quickly as to be blurred. This is really easy to do using the compositing nodes. The first step is to turn on “Vec” in your Render Layer buttons:
Now in your Node Editor window you will find that your “Render Layer” node has another output that wasn’t there before called “Speed”. So now add a Vector Blur Node (spacebar, add, filter, vector blur), and hook it up to what you already have like this. (Again, I’ve turned off the background and arranged the nodes to try to best show the hook ups)
The BlurFac field in the Vector Blur controls how intense the blurring is. Here are a couple of renders to demonstrate the vector blur effect. I’ve bypassed the DOF nodes setup in these examples so that we can see the effects of just the “speed” blurring. The first one is without, the second one with Vector Blur. I turned the BlurFac up to 1.25 for this.
This vector blur technique can also be used on any of your other projects. A spinning propeller, a thrown ball, anything in motion, and the extent of the blurring is also based on how much distance something is traveling between the current frame, and the frames before and after it. Another really cool thing with using these compositing nodes is that it adds very, very little time to the overall render. The difference in an 800x200 render with AAO on, with nodes activated and without is only about 3 seconds! Okay then that does it. I think I’m going to wrap it up. This has turned out to be a little longer of a tutorial than I had started out to make, but that’s okay, it was fun!! A few ideas that you could do to improve on this animation… You could add objects onto the spaceship mesh, like I have a Blender Logo that that I fly past in my final animation. You could always add things to the space ship, a control tower, spinning gun turrets, spinning radar-type dishes. You could make the guns firing whatever it is that guns fire on spaceships the size of a small moon. You could make the ship you’re flying in visible in front of the camera,
just make a ship object and parent it to the camera. You could add some "wobble" to the camera, have it move left to right, up and down, rotations, as long as the first and last frames remained the same, it would still work in a looping animation. You could also make the base animation a lot longer if you didn’t have the restrictions on size that I talked about earlier for my .gif. Another good thing about having an animation that you are able to “loop” is that if you wanted to extend this to say a full 2 or 3 minutes, if you tried to make a discombobulated plane that large, your vert count would be so huge that it would crash your computer, guaranteed. With an animation that would loop, you could make, say a 250 frame animation, and then just tweak it a little, adding this, removing that, small changes in camera rotation/wobble, etc, and then put them all together in the sequence editor to make one long animation. Alright, I hope somebody will find this tutorial helpful, and thanks for taking time to read it all the way to the end. HAPPY BLENDING!!!!!!