Skip site navigation
HubbleSOURCE

Informal Science Education Resources
from the home of NASA’s Hubble Space Telescope

Articles

Constructing a Planet in Adobe After Effects 6.5
Bryan Preston, Office of Public Outreach

Adobe After Effects is generally thought of as a motion graphics or title creation program. But one of After Effects' more unheralded features is its ability to support the creation of true animations and special effects, the kind you can use to bring a little extra pop to your planetarium shows and presentations. For instance, though After Effects is a 2-dimensional animation program (meaning you can't build true 3D models in 3D space), you can use it to make some very 3-dimensional looking animations, and it does have a 3D camera with 3D lighting built right in. This tutorial will show you how to build a planet using nothing more than flat 2-dimensional textures and a little bit of After Effects' deep capabilities.

First, we need the textures, and NASA has helpfully posted them on the web. You'll find them and much more at NASA's Earth Observatory web site, which has earth textures based on the data from a couple of NASA's earth science satellites. Since they're NASA data, they're in the public domain. You can use them as much as you want without having to pay royalties (you already paid the “royalty” on April 15th ). Once you're on the Earth Observatory's page, scroll to the bottom and download two textures—the daytime earth texture with clouds and the night lights texture. Make sure to get textures of the same resolution, for our purposes the ones that are 2048 pixels by 1024 pixels will do. After Effects will accept imagery of any size and will render to any size (from tiny web movies to DVD's to IMAX and everything in between), but you want to make sure in this case to get two texture images of equal resolution. We're going to make a planet out of them, and that's easier to do if they are a matching pair.

Once you've downloaded the images, open up After Effects. You'll need to import the two textures, and to do that go to File/Import/File, navigate to the images and click OK. Note that they have shown up in your Project window, and if you click on them individually After Effects will pop up a little thumbnail image and tell you a little about them—their resolution, etc. Now you need to make a Composition, which is where all the action in After Effects takes place. To make a new Composition, go to Composition/New Composition in your menu, or just hit Control+N. You'll get a dialogue that lets you set the parameters for the Comp—set it to NTSC D1 720x486, .9 pixel aspect ratio, 29.97 frames per second, length of 10 seconds. You're working in TV resolution with a TV frame rate, but After Effects can also work in film resolutions and frame rates.

Comp Window

You have a Comp now, so the next thing you need to do is start building your planet. With one of After Effects’ built-in plug-ins, it’s surprisingly easy. First, click and drag the daytime texture into your Timeline. Note that it has shown up in your Timeline as well as in your Comp window, and that it’s flat. It looks nice, but not very planet-like.

Comp Window

To make it look like a planet, we need to wrap it around a sphere. With the texture selected, go to Effects/Perspective/CC Sphere.

Effect

When you click on that effect, two things happen. First, in your Comp window the flat texture gets wrapped around a sphere that is lit from the left. Second, your Effects Window pops up and shows that you’ve applied the CC Sphere effect, and shows you that you have some parameters you can adjust. In the Effects Window, as well as in the Timeline if you twirl down the Effects twirly-gig on your texture layer, you can mess with the effect’s lighting and camera controls. You can also make the planet rotate, make it larger or smaller in the screen and tell it whether it should render only the sphere’s exterior, interior, or both, and with or without internal shadows.

Effects Controls

For our purposes, resist the temptation to fiddle with all those controls and focus on the Light parameter. Twirl it down and you’ll see that by default After Effects has lit the sphere from –85 degrees. I don’t know why that’s the default. It’s sort of like the default red text that After Effects generates when you apply that effect—it’s most likely there to force you to change it. Who uses red text as a default style? Who lights their planets from –85 degrees?

We want our planet lit from a more pleasing and dramatic angle, so change the Light Direction from –85 to +54. There are two ways to do that. One, just click in the Light Direction wheel until you get to +54. Two, click on the –85 itself and type in 54. Either way will give you the same result, which is to move the light from one side of the Earth to the other. To make the scene even more pleasing, we should change the height of the light, from its default 40 to 13. Turn off the Ambient light by clicking on its default setting and typing in 0. If you’ve done it correctly, your planet should now look like this (note that the planet appears slightly elliptical here because we're displaying a video image on a computer display, so pixels that are supposed to be non-square are shown as square):

Planet

Now let’s make it rotate. First, in the Effects Window twirl down the Rotation parameter. You’ll see three wheels, for X, Y and Z. Three dimensions in a 2-dimensional program!

Effect Parameters Window

You could mess with all three dimensions and create a dizzy earth, but you don’t need to for this tutorial. We’ll only need to rotate in the Y-axis, so just click on the little stopwatch next to the Y-axis wheel. Go to your Timeline and with the layer selected, and hit the U key. You’ll see a little diamond has appeared in the Timeline. That’s a keyframe, and you created it when you hit the stopwatch. Keyframes are what you use to make things go in After Effects. Hitting the U key exposes all keyframes set on a given layer—the more keyframes you set to create effects, the handier the U key becomes. To make our planet rotate, we’ll need to set another keyframe at the end of the Comp, so hit End and your time marker will move from the start of the Timeline to the end. Above the Y-axis wheel there are a couple of numbers, 0 and +0.0. The first 0 denotes the number of rotations, the second set denotes degrees. We just want to make the planet rotate twice, so click on the first zero and type in 2. If you click and drag the time marker in the Timeline, you’ll see that your planet is rotating. You can hit 0 on the number pad on your keyboard, and you’ll start building a RAM preview of your animation, which will show rotation on your planet.

But a rotating planet without some nod to the night is kind of boring. So first hit Home, then click and drag your second texture image from the Project Window into the Timeline, and make sure to place it below the texture that you’ve already turned into a sphere. You’ll see the night texture in the Comp Window, but flat. Apply the CC Sphere effect to it the way you applied it to the first texture, and your texture will disappear. It’s actually behind the first texture, and by clicking on and off the little eyeball icon in the Timeline next to the first texture, you can see that your night lights texture is there, is a sphere and is lit from the left. The problem is, you can’t see the night texture unless you turn off the day texture, and that doesn’t help sell the sphere as having a night side rotating into day. We need to see the night texture transition gradually from darkness into daylight.

Before doing that, though, we need to make it rotate. Do that the way we did the first, making sure that your first keyframe is at the Comp’s start and the second keyframe is at the end, and that you’re rotating the sphere twice. Its speed should match pixel for pixel with the first sphere, otherwise the effect won’t look right.

So now we have two rotating spheres, the day side covering up the night side. We need to make the transition from night to day, and the way to do that is with a luma matte. Matte channels tell a layer what parts are to be seen and what parts are to be invisible, and we can use one here to make the lit part of the dayside earth visible while making its dark side invisible, which will reveal the night side with lights.

To build the matte, we’re going to build a sphere out of nothing. Go to Layer/New/Solid, and click. In the dialogue box that appears, make the Solid white and give it a size of 2048x1024 to match your texture layers, and change its pixels from .9 to Square.

Solid Footage Settings Window

Use CC Sphere to turn this layer into a sphere, and line it up with the daytime sphere so that it covers it and their edges meet precisely. Light it from +54 degrees.

Comp Window

This new sphere is your top layer, and if you click on the Switches/Modes box at the bottom center of your Timeline, you'll notice that the settings change.   In the column called TrkMat, set the daytime layer's matte to Luma Matte “White Solid 1” (or whatever you named the solid you created in the previous steps).

Timeline Window  

Voila! You can now see the dayside of the earth on the right and the night side toward the left. Scroll across the Timeline and you’ll see that it’s animated and the night side is rotating smoothly into day. To change the transition region’s lighting, adjust the light on the White Solid’s CC Sphere Effect. If you want to make the night side a little more visible, increase its Ambient light from 10 to 50 or more.

Finished Effect

Using this effect, you can create space scenes that include camera moves, sunrises—just about anything. You can project your rendered animation onto your dome or screen, surround it with slides or other graphics, and add a little bit of realism to your shows.

 

This site is not displaying properly. Tell me why!