A 5-Part Exploration Of After Effects Spiral Filters
by Brian Maffitt, MAFF/x Inc. & Total AE

Chapter 1 - Introduction
Or "This guy again?"

Macintosh 2D and 3D animators have long been able to map moving textures onto 3D objects. In most 3D programs you can map a texture onto anything and in a variety of ways: spherical (i.e. mapping the world map from the Apple Scrapbook onto a ball to make a globe), planar (i.e. mapping a movie onto a TV screen), cylindrical (a label on a beer can), cubic (holiday wrapping paper on a box). In After Effects you can rotate a plane in 3D or, if you have the Final Effects filters from MetaTools, you can map an animation onto a sphere or onto tumbling polygons.

Note: There's also procedural mapping, in which the texture is based on a mathematic algorithm, but we won't go into that here.

By mapping an animation onto an object, moving elements appear to move across the object's surface. There are limits to the kinds of animations you can do, however current mapping techniques basically wrap an object with a texture as if it were a decal. This means that somewhere on the object a seam will appear. If you want something to travel around an object, then it had better disappear on one side of the seam in the same spot that it reappears on the other and it better have the exact same size, speed, and rotation settings or it'll look icky.

Because of these limitations, mapping an animated helix (think spiral staircase or DNA molecule) has always been a tricky proposition, and has remained largely an un-animated phenomenon on the Mac platform. With After Effects 3.0, however, you have very precise control and high-quality sub-pixel rendering... and with a little grade school math (really!) you can crank out a complicated helical animation in a jiffy.

Note: Actually, a DNA molecule is a double-helix, which is also easy to animate, as you will see.


Just to wet your appetite, click on this image:

 

Chapter 2 The FE Sphere Filter
Or "There's nothing to sphere but spheres themselves"

When the European company UDAC Multimedia introduced the Final Effects filters in 1995, it ushered in a new age in Macintosh special effects. Half of the filters were well worth the price of admission, the other half were magic.

One of the many gems of Final Effects version 3.0 is the FE Sphere filter, which takes any After Effects layer and makes a ball out of it. The tilt of the sphere can be animated on any axis, lighting effects such as ambiance, diffusion, roughness, etc. c an be set with great precision and animated over time, the sphere can reflect its environment, and it can create ray-traced internal shadows based on the transparency of the layer. Not even ElectricImage can do that.

All of the fancy doodads are worth exploring, but you can figure them out easily enough by just playing with different settings. Rather than dwell on such basics, this tutorial will concentrate on a few of the interesting, less obvious abilities of this t ool.

First of all, it's important to know that the filter is optimized to work on layers that have a 2:1 aspect ratio that is, layers that are twice as wide as they are tall. Things at the top and bottom of the sphere are always going to get squished, but with a 2:1 ratio, things around the equator will look nicely proportioned. You can apply the filter to any layer of any proportion, but skinnier layers will be stretched until they look fat, while wider layers will look like the titles of a Cinemascope movie that have been compressed to fit on a TV screen. Stick to 2:1 when possible.

When you apply the filter to a layer, the extreme right and left edges will meet at the back of the sphere.

Take a look at this image (the checkerboard indicates transparency):

 

When the FE Sphere filter is applied, it looks like this:

 

Adjust the z and y rotation parameters, and you can get a clearer look at the back:

Every layer maps this way. It might seem like this is restrictive, but once you understand how layers interact with each other, there are a lot of possibilities.

So how do I make text "spiral" around a sphere?

 

Chapter 3 The Problem
Or, "This is easy, right? I just gotta tilt it, right?"

Note: I'm sorry if I'm a little slow in getting to the meat of this tutorial, but I believe that a firm understanding of the problem is necessary before one can achieve a solution. If you think this is getting boring, skip on to the next chapter.

It's fun to apply the FE Sphere filter to an animated layer in fact, that's when the filter really begins to shine. If the layer is completely solid, there's nothing much to worry about beyond pleasant lighting. But if parts of the layer are transparent a ny part that reveals the back "seam" then you have to be careful that what's going on at the seam doesn't look crummy.

Take a look at this AE layer:

The top line has half an "x" on one edge and half an "o" on the other. The bottom line has exactly half of an "o" on both sides. This second one is more or less what we're going for apply the FE Sphere filter to this layer and this is what you get:

It only takes a little bit of effort to get a line of type to exit in a wrap-friendly matter; AE can adjust scale and position with extremely minute precision, and with a bit of dickering almost anything repeatable can be wrapped convincingly. It also hel ps to design the type (or whatever graphic element you want to wrap) in Photoshop, where, with some judicious use of the Offset filter (or even the KPT Seamless Welder filter, although it doesn't work with type) you can fine-tune an element so that it com es in without a visible seam.

With a helical map it's a differrent matter. A helical map has to follow some basic rules that are best illustrated with, well, some Illustrations

At first glance a helix seems simple. It shouldn't even have to wrap, right? It just needs to travel around the sphere a few times, never touching itself. As a matter of fact, a simple, one-twist helix is very simple. If you move your text (or whatever) across the screen, thus:

Then you get a little helix animation that looks like the "Introduction" graphic on page 1. Cute, but unimpressive most people want their animation to corkscrew around the object several times. Well, although it doesn't look like it, in order for an anima tion to do this, it needs to wrap:

If your animated element is to spiral around an object, then it needs to exit one edge at exactly the same speed, size, and angle that it emerges from the other side. This is "all" your animation has to do to wrap correctly.

Stop laughing. Certainly, this is not as easily faked as a simple, horizontal move. The slightest difference in angle, velocity, or scale will throw the whole thing out of whack.

The Problem, therefore, was "how can I bring the calculating power of AE to bear on this task?"

With a combination of comps and filters it must be possible to if not actually automate the process at least make it relatively painless.

The answer looks complicated, but it's deceptively simple, and depends on a filter the After Effects eqivalent to a Photoshop plug-in that we've already mentioned:

The Offset filter.

The music swells.

 

Chapter 4 The Solution
Or, "Cut to the friggin' chase already!"

Note: Although for the sake of simplicity I'm going to be mapping a texture onto the FE Sphere filter, remember that the results of this technique will apply to any texture -- cylindrically mapped onto practically any object -- in any 3D program.

All right. I'm going to show you how to create a helix-friendly animated layer in After Effects. If you skipped the rest of the tutorial to get to this part, welcome. If you waded through all the basics, good for you -- you probably have figured out the a nswer by now.

I'm basically going to walk you through the process step-by step, so, if you have the RAM, go ahead and open up AE and follow along. We'll skip the math for now (it's easy, though).

First, create a new project (duh). Import the Illustrator file "Unstoppable text" from the folder "Project Files". A file 4000 pixels wide and 17 pixels high should be in your project window.

Note: It would be great to use a continuously-rasterized Illustrator file in this process; unfortunately, you can't apply filters to a continuously-rasterized Illustrator file. We need filters, so I make my Illustrator files as big as I ultimately need th em -- one point size for every pixel in AE -- and they work fine. AE layer dimensions are currently limited to 4000 pixels, so a 4000 pixel Illustrator file (or comp) is as wide as we can go.

Make a new comp (command-n) 4000 pixels wide by 500 pixels tall, and make it 15 seconds long. Call it "4000x500". I know, I know -- we're supposed to be using a comp with a ratio of 2:1, not 8:1! What gives?

Don't worry about it. All will become clear...

Zoom out (command-minus) until you can see the entire comp in your window. Drag the file "Unstoppable text" into the center of the comp, where it should snap. Check its position--sometimes the snap fails with comps this size -- the positional values shou ld read "2000,250" . Adjust them if necessary.

Next, zoom in to the upper left-hand corner of the comp. We're going to rotate the "unstoppable text" layer and use its own bounding box as a "ruler" to align the image. We want the lower left corner of the "Unstoppable" layer to precisely line up with th e upper left corner of the comp. It should only take a few seconds of typing in values to accomplish this (if you have a large enough monitor you can use the mouse tools as well). The only really important thing is to turn off "Preserve frame aspect ratio " in the "scale" setting, because you ONLY want to scale the width of the layer. You want the corners to align like this:

If you want to cheat, these values will give you the results you need: Scale -- 100.75% x 100%, Rotation: 7.36 degrees.

Please don't panic at this point; once you get how this works you will find that this is not as complicated as it seems. In fact, the precision of this step is usually not required -- I've only included it because it yields the best results.

If you zoom out now, you'll see that the "Unstoppable" layer now stretches perfectly from corner to corner:

We've just determined the optimal angle that the "Unstoppable" layer can travel from corner to corner without encountering the side edges of the comp. Reduce the horizontal scale of the "Unstoppable" layer back to 100%. You won't need to deal with the sca le settings again. Save the project at this point.

Note: Whenever you use this technique, always stay away from the side edges when possible. The Offset filter will take care of any seams we will encounter, and the Sphere filter will reduce the horizontal edges of our file to single points, so try to set up your animations so that the elements only encounter the top and bottom edges.

You're still zoomed out, right? Making sure the timeline is set to zero, drag the "Unstoppable" layer until the upper left point of the layer's bounding box is exactly in the lower right corner of the comp. Zoom in and use the cursor keys to align it prec isely. If you want to cheat, the positional values of 5983, 765 should be about right. Click on the stopwatch next to the "Position" label to set a keyframe.

Move the timeline I-beam to 14:29 (the last frame in the comp). Zoom back out and drag the layer so that its lower-right point is aligned with the upper left corner of the comp. Zoom in to get a better look, and use the cursor keys to adjust the layer un til it is exactly in place. The values should be -1983, -265.

Now you have an animation where the "Unstoppable" layer travels from the lower right corner to the upper left corner in a straight line that is exactly parralel to the rotational angle of the layer. Drag the I-beam around to make sure that the motion is w orking and that all of the keyframes have set themselves properly. When satisfied, save.

Note: We learned in an earlier chapter that the FE sphere filter likes comps to have a 2:1 ratio. Our Sphere comp will eventually be 1000 pixels wide and 500 pixels tall... but we want our type to spiral around our sphere four times (this number can be an ything within reason and RAM. For our purposes we're keeping it simple). The 4000-pixel-wide comp is important: we want four twists in our helix, and the comp is four times wider than our target sphere comp will eventually be.

Pre-compose the "Unstoppable" layer. Call the new comp "Unstoppable Comp" and pick the "Move all attributes into the new composition" option.

Now it's time for the Offset filter. It's located under "Distort" in the "Effects" menu (I'm not sure why. I guess it didn't fit anywhere else). Adjust the timeline of the comp to around 7 seconds. Apply the filter, and change the center from "2000, 250" to "0, 250". Examine the results.

The Offset filter works by shoving a layer off one side while wrapping it back on the other. It works with great precision and in any direction, but for this exercise we'll only be applying it to horizontal values. The "Unstoppable Comp" should now contai n two separate strands of text instead of one long piece:

Duplicate this comp three times (command-D D D). Double-check that the offset values of the first layer are set to "o, 250" (already set), and then set the offset values of the subsequent layers to "1000, 250", "2000, 250", and "3000, 250". The comp shoul d now look like this:

Note: For future reference, you only really need to apply the Offset filter to three of the layers, since the one you start out with will be set to "2000, 250" by default.

Now we're in business. Create a new comp, make it 1000 x 500 pixels and accept the duration of 15 seconds. This will be our source comp for our Sphere. (IMPORTANT: This would also be the layer we'd render if we were going to map the texture on to an objec t in another program.) Drag "Comp 1" (the 4000x500 comp) into the new, 1000 x 500 comp:

Drag the I-beam back and forth in the time-line, and note that anything that disappears off of one edge immediately reappears on the other. Interestingly, it doesn't matter in the slightest if the wider comp is centered right to left or not -- it will wo rk regardless. And trust me, AE makes sure that this is pixel-perfect. Save.

Now we need to make the destination comp for our sphere. Assuming most of you are working at video res, make a 640 x 480 comp, and call it "640x480". Drag the "1000x500" into the center of this comp, and don't resize it. The Sphere filter will take care o f that.

Drag the I-beam to about 4 seconds, so you can see some text creeping up into the window, and apply the FE Sphere filter. It's located under "Perspective" in the effects menu. Adjust tohe radius to ".7" or thereabouts. Your comp should now look something like this:

Render an animation from this comp and its motion should look something like this:


(click to play)

Now for the math: 1000 x 500 is a nice, easily divisible size for a Sphere comp to be. Knowing we will be using a comp this size, our initial, wide comp should be a multiple of 1000 -- 2000 pixels wide for two loops, 3000 for three loops, etc. One caveat: you can't have a comp wider than 4000 pixels, so you'll have to jump through some hoops to get more than four loops using this method. You can of course reduce the size of the sphere comp to something like 800 x 400 or even 600 x 300, but this will limit the quality of your final sphere, particularly if you scale it up. And remember, the wide comp needs to be a multiple of the width of the smaller comp: an 800 x 400 destination will need a 1600 x 400, 2400 x 400, 3200 x 400, or 4000 x 400 initial wide co mp.

Of course, there's another method to add more than four loops with a 4000-pixel comp, but I'll get to it in the next chapter.

Having fun yet? Was it worth the wait? Does it even make sense?

 

Chapter 5 - Advanced Techniques
Or, "Thank goodness for RAM"

The Double-Helix

Now that you understand the basic technique, you can start playing with things. First, let's make a double-helix.

Follow the steps to create the 1000x500 comp in the last chapter. Then create a new 1000x500 comp (call it 1000x500 Mark II) and import two copies of the original 1000x500 comp. Place them both in the center of the new comp.

Select the topmost layer and apply the Offset filter. Change the offset value from "500, 250" to "250, 250". Now you've doubled the number of lines in the comp without changing the aspect ratio, so twice as many lines of type (2) will chase each other around the surface of the ball.

Import this comp into your output comp (the 640x480 one) and render the results. A perfect double-helix sphere.

The hi-res 16-loop helix

This one takes a little patience, and a lot of RAM.

Once you've created the 4-layered offset 4000 x 500 comp, create a new 4000 x 2000- pixel comp, and make its time span something more like 45 seconds. Drag four copies of the 4000x500 comp into the new, bigger comp, and spread them out vertically so that the combination of the four covers all of the available space. It's best to do this by entering positional data: the top layer should be at "2000,250" the second layer at "2000,750", the third at "2000, 1250", and the fourth at "2000, 1750".

Now for the patient part. Adjust the time so that the type is exiting out of the top edge of each layer--ten seconds should do it. Zoom in to get a clear view of the seam between the bottom two layers. Select the second layer up in the timeline and drag its "time-bar" over to the right about five seconds. Now you should have enough of a reference to adjust the position of the second layer: apply the offset filter and adjust the values until the paths of the lines line up perfectly.

Next, adjust the temporal position of the second layer (drag it around on the time-line) until the letters align as closely as you can get them. It's not likely that they will align perfectly--this is one of theose silly seams we have to create by hand. Get it as close as you can, then use the mask settings to shave off a pixel or two at the bottom of the second comp, and nudge with the cursor keys until the two layers mesh perfectly. As I said it takes a little bit of patience, but it can be done. Repeat this process for the other layers and proceed from there to the Sphere filter comp.

Here's proof of a two-layer seam operation: an eight-loop double-helix halfway into its cycle.

The Gen-yoo-wine Spiral

This is not really that advanced, but it may not be obvious: when rendering the sphere, turn it 90 degreed on the x-axis and only render the backside. You'll get a spiral animation! Much easier than motion tracking or offsetting layers.

Other filters

Don't forget that any layer can be filtered in AE (as long as it's not a continually-rasterized Illustrator file) and if you apply a filter to the 1000x500 comp before you spherize it, you can get some interesting effects. It's easiest to play with distortion filters that effect only the center of the image (hence the front of the sphere) and not the edges (don't want to muck up that seam, now, do we?). The Wave warp filter and the PS Twirl are just a couple of filters that fit this discription.

Just be sure to pre-compify the 1000x500 comp (or the filter will apply to the whole, wide layer). A little experimentation and you can get effects like this:

The PS Twirl filter:

The Wave Warp filter (Triangle wave):

The FE Kaleida filter:

and Kaleida again:

And Don't forget 3D programs... map a spiral layer onto a 3D object andyou can get results like this:


(Click to play)

This texture was mapped onto a cone. The camera was located inside the object, oriented towards the point.

As usual, the possibilities are endless... and occasionally dazzling. Above all, blow the socks off your clients. Well, that's it! A neat trick to impress your friends. I hope it was worthwhile. Somebody needs to come up with an acceptable synonym for "comp".

If you found this tutorial to be useful, let me know. As always, I welcome all comments.

Brian Maffitt

Special thanks to Total Training for allowing us to re-print this tutorial