LIBRARY: Tutorials Reviews Interviews Editorials Features Business Authors RSS Feed

Creating A Sunrise Using Expressions

Creating A Sunrise Using Expressions
A CreativeCOW.net Adobe After Effects Tutorial


At Sunrise

Mylenium
Mylenium
http://www.mylenium.de
Germany

©Creativecow.net. All rights are reserved.
Article Focus:
The goal of this mini-tutorial is to show you some basic targeting using expressions as well as a few other tricks. Not only can this be used to create a stylized sun but also for lasers firing or wormholes.


Download the project files here.


Preface

The final result of this tutorial could also be achieved using manual techniques with 3D layers and a look_at expression. "So, what's the point then ?" you may say. Apart from my technique being largely automated once it is set up, there are several other things to consider:

a) 3D layers are slower than 2D layers, both while editing and when rendering.

b) Artifacts. Even though After Effects keeps getting better in 3D, it still is a rather weak tool for that kind of compositing. Even the advanced 3D renderer is far from being really advanced (nowadays it more like deserves the title "average" or "mediocre"). It's slow, has serious motion blur and anti-aliasing problems, causes quite often crashes (because it runs out of memory) etc..

c) There is a mathematical problem - at one point our layers are likely to show unwanted flipping if they were 3D. There are ways to avoid and compensate for it, but we will spare ourselves the trouble this time around.

That's why I try to avoid 3D in After Effects whenever possible and settle for 2D solutions instead.



Step 1: Setting up the project

Unlike in some of my other tutorials this is really simple this time. If you like, you can even do everything in one comp but I prefer to have two compositions - the main one called Sun and one separate comp for the Beam element. Apart from that, we only need to add two layers (or Null objects) to the main composition which will control everything. I named them Center and Target and Controller. Imaginative, isn't it? You can modify Center in any way you like and use it as the disc of the sun. The other layer will remain hidden and is really only used for animation and setting parameters. To keep things simple I only added a slider expression control and called it Radius.


Step 2: Beam me up Scotty

The look of the Beam is really very much a matter of your personal taste. The only immediate requirement is to make the composition 1000 pixels wide. This will simplify calculations later on. You may use other values, but I suggest to always use multiples of 100 (the reason why is explained in the Grid tutorial). Keep in mind that the more beams you use, the finer they should be. Now drop it into the main composition and set its anchor point to the leftmost edge.


Step 3: Expression time

The Beam layer uses expressions on all three standard transformation properties. First let's take a look at the position property.
center_X=thisComp.layer("Center").position[0];
center_Y=thisComp.layer("Center").position[1];
radius=thisComp.layer("Target and Controller").effect("Radius"("Slider");
my_angle=Math.PI*2/(thisComp.numLayers-2)*(index-2)-degreesToRadians(thisComp.layer("Center").rotation);
position_X=center_X+Math.sin(my_angle)*radius;
position_Y=center_Y+Math.cos(my_angle)*radius;
[position_X,position_Y]
What are we doing here? The position of a point on a circle can be expressed as functions of sines and cosines. Unfortunately the result of those is always somewhere between -1 and 1. Therefore we must multiply the results with the Radius from our Target and Controller layer and add the values to the position values of Center. Otherwise our sun would always stay in the top left corner where After Effects' coordinate system has its origin. Furthermore we are also taking precautions and already factor in a possible rotation of Center which we need to convert from degrees to radians. The circle itself is defined as a function of Pi. To split it into equal segments, we need to divide it by the number of layers in our comp (minus the two control layers).

The rotation is calculated very much as a standard targeting function:

diffX=position[0]-thisComp.layer("Target and Controller").position[0];
diffY=position[1]-thisComp.layer("Target and Controller").position[1];
myRot=radiansToDegrees(Math.atan2(diffY,diffX))-180; [myRot]
The last expression is also the simplest one. The scale is calculated as follows:
[length(position-thisComp.layer("Target and Controller").position)/10,100]
And that's it! Now go ahead and clone the Beam layer a few times and see the sun shine into your life ;o).





Feel free to ask questions regarding this tutorial in the After Effects forum at Creativecow.net


Please visit our forums at Creativecow.net if you found this page from a direct link.



Related Articles / Tutorials:
Adobe After Effects
Adobe After Effects: Glitch Effects Without Using Plug-ins!

Adobe After Effects: Glitch Effects Without Using Plug-ins!

Join VFX guru Tobias Gleissenberger for a fun, high-energy look at how to create all sorts of digital noise, glitch, and other disturbing video effects with any version of Adobe After Effects, without using any plug-ins!

Tutorial
Tobias Gleissenberger
Adobe After Effects
Adobe After Effects Energy Ball

Adobe After Effects Energy Ball

In his latest high-energy Adobe After Effects tutorial, VFX guru Tobias Gleissenberger of Surfaced Studio combines a variety of effects to create the pulsating energy ball, composited with motion tracking, optical flares, and more.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Stabilize 360 Video with Mocha VR

Stabilize 360 Video with Mocha VR

In this intermediate tutorial, Mocha Product Manager Martin Brennand takes you through smoothing the horizon in a Samsung Gear 360 shot using the Reorient Module in Mocha VR. Jittery 360 video footage can be made more watchable by stabilizing with Mocha’s planar tracking tools. The tutorial is done via the Adobe After Effects plug-in, but the techniques apply to all versions of Mocha VR.

Tutorial
Imagineer Systems
Adobe After Effects
Adobe After Effects April 2017 New Features

Adobe After Effects April 2017 New Features

The April 2017 release of Adobe After Effects (version 14.2) is packed with new features, and Tobias Gleissenberger of Surfaced Studio is here to show you the latest and greatest. Highlights include the Essential Graphics panel and Motion Graphics templates (with Adobe Premiere Pro integration), the addition of Lumetri Scopes and Color Correction effects, new effects organization, the Camera Shake Deblur filter and more.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Adobe After Effects Advanced Title Tutorial

Adobe After Effects Advanced Title Tutorial

Learn how to create complex title animations in Adobe After Effects! In my last tutorial I covered how to create, customise and animate simple titles in Adobe Premiere Pro: https://www.youtube.com/watch?v=6xQtq... In this tutorial we will take things one step further and create titles that are too complex to create with Premiere alone. We will be working with and customising presets, creating character by character animations and we will look at the power of custom Text Animators. Want to learn more about how to animate text? Check out the Adobe help page: https://helpx.adobe.com/after-effects...

Tutorial
Tobias Gleissenberger
Adobe After Effects
Imagineer mocha Pro 5 Plug-In for Adobe: An In Depth Review

Imagineer mocha Pro 5 Plug-In for Adobe: An In Depth Review

Imagineer mocha Pro 5 Plug-in for Adobe brings all the amazing features of the professional version of the mocha Planar Tracker directly into After Effects and Premiere Pro in the form of a plugin. In this in-depth review, After Effects tutorial guru Tobias Gleissenberger of Surfaced Studio will show you what you can do with this new plug-in, and discuss what he likes and doesn't like about the new update.

Tutorial
Tobias Gleissenberger
Adobe After Effects
After Effects 2015.3 - My Favorite Features

After Effects 2015.3 - My Favorite Features

Learn why you should upgrade to After Effects CC 2015.3 - 13.8.1 - a close and detailed look at the latest release of After Effects (August 2016). Roei Tzoref will be focusing on his favorite features that set this release apart from previous versions: Performance, Queue in AME, Lumetri Color new features, and more.

Tutorial
Roei Tzoref
Adobe After Effects
Advanced Masking in Adobe After Effects

Advanced Masking in Adobe After Effects

Some of the coolest stuff you can do inside of Adobe After Effects is only possible once you unlock the power of masks. Join After Effects whiz Tobias Gleissenberger of Surfaced Studio to learn about mask animation and interpolation, using the variable width feathering tool, managing mask modes and ordering, and more.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Fixing Common After Effects Problems and Mistakes

Fixing Common After Effects Problems and Mistakes

Got problems using Adobe After Effects? Exported files too large, Expressions not working, mixing shapes and makes, modes/switches, selecting previews for layers vs. comps - Surfaced Studio's Tobias Gleissenberger shows you fast fixes for these and more!

Tutorial
Tobias Gleissenberger
Adobe After Effects
mocha AE Planar Tracker for Absolute Beginners

mocha AE Planar Tracker for Absolute Beginners

Want to learn how to create advanced visual effects? Learn how to use mocha AE to track your shot and add advanced visual effects to live action footage inside Adobe After Effects. mocha can help you track shots that would be hard to track using traditional 2D point or feature trackers because it is a PLANAR TRACKER. A planar tracker uses planes and textures to track as opposed to points or groups of pixels. This allows the tracker to stay on track even if your shot contains motion blur or a very shallow depth of field. mocha AE comes included with Adobe After Effects and is available since CS3 and there is no reason for you not to use this awesome tool to make it easier for you to track your shot, replace screens or rotoscope!

Tutorial
Tobias Gleissenberger
MORE
© 2017 CreativeCOW.net All Rights Reserved
[TOP]