0% found this document useful (0 votes)
4 views15 pages

Ae 3d Rotation Guide

The After Effects Expression Guide provides two expressions for 3D rotation: Orbital Tumble and Gyroscopic Drift, allowing for complex motion in 3D layers. Orbital Tumble creates a continuous, looping rotation across all three axes, while Gyroscopic Drift offers a gentle, organic rocking motion. The guide includes detailed instructions for applying these expressions, tuning parameters, and examples for various visual effects.

Uploaded by

tohuuphan1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

Ae 3d Rotation Guide

The After Effects Expression Guide provides two expressions for 3D rotation: Orbital Tumble and Gyroscopic Drift, allowing for complex motion in 3D layers. Orbital Tumble creates a continuous, looping rotation across all three axes, while Gyroscopic Drift offers a gentle, organic rocking motion. The guide includes detailed instructions for applying these expressions, tuning parameters, and examples for various visual effects.

Uploaded by

tohuuphan1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

After Effects Expression Guide

AFTER EFFECTS
EXPRESSION GUIDE

Two Expressions for 3D Rotation

Orbital Tumble + Gyroscopic Drift

X / Y / Z Axis Control for 3D Layers

Motion Design Reference | 2026 Edition

Page 1
After Effects Expression Guide

Introduction

Three-dimensional rotation is where After Effects expressions truly earn their keep. In 2D,
rotation is a single number: degrees around the Z axis. In 3D, rotation splits into three
independent axes (X, Y, Z), and the interactions between them create complex, organic-looking
motion that would take dozens of keyframes to build by hand.
A 3D layer in After Effects has three separate rotation properties: X Rotation, Y Rotation, and Z
Rotation. Alternatively, these can be controlled together through the Orientation property, which
accepts a three-element array [xDeg, yDeg, zDeg]. Both approaches work; this guide uses
individual axis expressions for maximum control and clarity.

Prerequisites
Before applying these expressions, the target layer must be set to 3D. Right-click the layer in
the timeline and enable the 3D Layer switch (the cube icon). This unlocks the X Rotation, Y
Rotation, and Z Rotation properties under Transform.
For the full visual effect, you will also want a camera in your composition. Add a camera via
Layer > New > Camera. A 50mm preset works well for most cases. Without a camera, After
Effects renders 3D layers using the default orthographic view, which flattens perspective and
makes rotation look less convincing.

The Two Expressions


1. Orbital Tumble — A continuous, looping rotation across all three axes simultaneously.
Each axis rotates at a different speed, creating a complex, non-repeating tumble that
looks like an object floating in zero gravity. The speeds are tuned to avoid simple
harmonic lock (where axes periodically align and the motion looks mechanical).
2. Gyroscopic Drift — A smooth, eased rotation that gently rocks on two axes while slowly
spinning on the third. The motion is organic and unpredictable thanks to layered sine
waves with irrational frequency ratios. It looks like a floating object caught in a slow
current — meditative, ambient, and alive.

Axis Reference
Understanding which axis does what is essential for tuning 3D rotation:
• X Rotation: Tilts the object forward and backward (nodding motion). Positive values tilt
the top edge away from the viewer.

Page 2
After Effects Expression Guide

• Y Rotation: Turns the object left and right (head-shake motion). Positive values turn the
left edge toward the viewer.
• Z Rotation: Spins the object in place (like a clock hand). Same as 2D rotation. Positive
values rotate counter-clockwise.
When multiple axes rotate simultaneously, the motions compound. An object spinning on both X
and Y at the same time appears to tumble freely in space, because the viewer perceives the
combined effect as a single complex rotation, not three independent ones.

Page 3
After Effects Expression Guide

Expression 1: Orbital Tumble

This expression creates a continuous, free-floating tumble. The object rotates perpetually on all
three axes at carefully offset speeds. The result looks like a piece of debris spinning in space, a
product rotating on an invisible turntable with wobble, or a card flipping through the void.

The Expressions (Three Properties)


Apply to X Rotation:
// === ORBITAL TUMBLE — X Rotation ===
speed = 45; // degrees per second (base speed)
startTime = 0.0;

t = time - startTime;

if (t < 0) {
value;
} else {
// X axis: primary tumble speed
value + speed * t;
}

Apply to Y Rotation:
// === ORBITAL TUMBLE — Y Rotation ===
speed = 45;
startTime = 0.0;

// Y runs at golden ratio offset to avoid sync with X


yRatio = 1.618;

t = time - startTime;

if (t < 0) {
value;
} else {
value + speed * yRatio * t;
}

Page 4
After Effects Expression Guide

Apply to Z Rotation:
// === ORBITAL TUMBLE — Z Rotation ===
speed = 45;
startTime = 0.0;

// Z runs at sqrt(2) offset: irrational, never syncs


zRatio = 0.7071; // 1 / sqrt(2)

t = time - startTime;

if (t < 0) {
value;
} else {
value + speed * zRatio * t;
}

How It Works
The core idea is deceptively simple: each axis rotates at a constant speed, but the three speeds
are related by irrational ratios. The X axis spins at the base speed. The Y axis spins at 1.618
times the base speed (the golden ratio). The Z axis spins at 0.7071 times the base speed (the
reciprocal of the square root of 2).
Because these ratios are irrational numbers, the three axes never simultaneously return to their
starting alignment. In mathematical terms, the motion is quasiperiodic: it never exactly repeats.
This is what prevents the tumble from looking mechanical or loopy. Every frame shows the
object at a unique orientation.
The value keyword at the beginning of each expression means the computed rotation is added
to whatever manual rotation you have set on the layer. If you want the tumble to start from a
specific orientation (for example, facing the camera), set that angle manually and the tumble
builds on top of it.

Parameter Reference
Parameter Default Effect
speed 45 Base rotation speed in degrees per second. All
axes scale from this.
startTime 0.0 Comp time when tumble begins.
yRatio 1.618 Y-axis speed multiplier. Golden ratio avoids
X/Y sync.
zRatio 0.7071 Z-axis speed multiplier. Irrational value

Page 5
After Effects Expression Guide

prevents Z alignment.

Page 6
After Effects Expression Guide

Tuning Presets

Slow Product Showcase (floating packshot)


// All three axes:
speed = 15;
// Slow, elegant. Object is always readable.

Space Debris (chaotic, fast)


speed = 120;
// Rapid tumble. Too fast to read details — conveys chaos.

Coin Flip (dominant Y axis)


// X Rotation: speed = 5; (minimal nod)
// Y Rotation: speed * 4.0; (override yRatio to 4.0)
// Z Rotation: speed = 5; (minimal spin)
// Most energy on Y axis: object flips like a coin.

Flat Spin (dominant Z axis)


// X Rotation: speed = 8;
// Y Rotation: speed = 8;
// Z Rotation: speed * 5.0; (override zRatio to 5.0)
// Object spins like a frisbee with subtle wobble.

Damped Variant (Tumble That Stops)


To make the object tumble and gradually come to rest, multiply the speed by an exponential
decay. Apply this version to each axis:
// === DAMPED ORBITAL TUMBLE — X Rotation ===
speed = 180; // high initial speed
decayRate = 0.8; // how fast it slows
startTime = 0.5;

t = time - startTime;

if (t < 0) {
value;

Page 7
After Effects Expression Guide

} else {
// Integral of speed * exp(-decay * t)
// = (speed / decay) * (1 - exp(-decay * t))
angle = (speed / decayRate) * (1 - [Link](-decayRate * t));
value + angle;
}

The integral form is important here. Simply multiplying speed by decay would make the rotation
slow down but also reduce the total accumulated angle. The integral formula ensures the object
rotates a finite total amount and smoothly decelerates to a stop. Higher decayRate values mean
it stops sooner; lower values mean it coasts longer.

Page 8
After Effects Expression Guide

Expression 2: Gyroscopic Drift

This expression creates a gentle, organic rocking motion. Instead of continuous full rotation, the
object tilts and drifts within a limited angular range, like a gyroscope losing stability or a satellite
slowly tumbling in a thin atmosphere. The motion feels ambient, meditative, and alive. It never
snaps, never repeats exactly, and never stops.

The Expressions (Three Properties)


Apply to X Rotation:
// === GYROSCOPIC DRIFT — X Rotation ===
amp1 = 25; freq1 = 0.15; // primary sway
amp2 = 12; freq2 = 0.37; // secondary harmonic
amp3 = 5; freq3 = 0.71; // micro-detail
startTime = 0.0;

t = time - startTime;

if (t < 0) {
value;
} else {
drift = amp1 * [Link](freq1 * t * [Link] * 2)
+ amp2 * [Link](freq2 * t * [Link] * 2)
+ amp3 * [Link](freq3 * t * [Link] * 2);
value + drift;
}

Apply to Y Rotation:
// === GYROSCOPIC DRIFT — Y Rotation ===
amp1 = 30; freq1 = 0.12;
amp2 = 15; freq2 = 0.29;
amp3 = 7; freq3 = 0.53;
startTime = 0.0;

t = time - startTime;

if (t < 0) {
value;
} else {

Page 9
After Effects Expression Guide

drift = amp1 * [Link](freq1 * t * [Link] * 2)


+ amp2 * [Link](freq2 * t * [Link] * 2)
+ amp3 * [Link](freq3 * t * [Link] * 2);
value + drift;
}

Apply to Z Rotation:
// === GYROSCOPIC DRIFT — Z Rotation ===
amp1 = 8; freq1 = 0.08; // slow, subtle roll
amp2 = 4; freq2 = 0.22;
amp3 = 2; freq3 = 0.47;

// Optional: slow continuous spin underneath the drift


spinSpeed = 10; // degrees per second (0 = no spin)
startTime = 0.0;

t = time - startTime;

if (t < 0) {
value;
} else {
drift = amp1 * [Link](freq1 * t * [Link] * 2)
+ amp2 * [Link](freq2 * t * [Link] * 2)
+ amp3 * [Link](freq3 * t * [Link] * 2);
value + drift + spinSpeed * t;
}

How It Works
Each axis is driven by three layered sine waves at different frequencies and amplitudes. The
primary wave (amp1, freq1) creates the broad, slow rocking motion. The secondary wave
(amp2, freq2) adds a medium-speed harmonic that modulates the primary sway, preventing it
from looking like a simple pendulum. The tertiary wave (amp3, freq3) adds micro-detail: tiny,
fast fluctuations that make the motion feel alive and imperfect.
The frequencies across all three axes are deliberately chosen to be mutually irrational. No two
frequencies share a common period, so the combined motion of all three axes never exactly
repeats. This quasiperiodic behavior is what makes the drift feel organic rather than
programmed. The object appears to respond to invisible forces rather than following a
mathematical pattern.
The Z axis includes an optional spinSpeed parameter that adds a slow continuous rotation
underneath the drift oscillation. This is useful for objects like logos or product models that need

Page 10
After Effects Expression Guide

to gradually reveal all sides while still drifting gently. Set spinSpeed to 0 for pure drift with no net
rotation.

Parameter Reference
Parameter Default Effect
amp1 25–30 Primary sway amplitude in degrees. Defines
the overall rocking range.
freq1 0.08–0.15 Primary sway frequency in Hz. Lower =
slower, more majestic.
amp2 12–15 Secondary harmonic amplitude. Adds
complexity to the sway.
freq2 0.22–0.37 Secondary frequency. Should not be a multiple
of freq1.
amp3 2–7 Micro-detail amplitude. Subtle texture on top of
the broad motion.
freq3 0.47–0.71 Micro-detail frequency. Faster than the other
two layers.
spinSpeed 10 Continuous Z-axis spin in degrees/second. 0
disables.

Page 11
After Effects Expression Guide

Tuning Presets

Floating Product Card (e-commerce hero)


// X: amp1=12, freq1=0.10, amp2=5, freq2=0.28, amp3=2, freq3=0.55
// Y: amp1=18, freq1=0.08, amp2=8, freq2=0.21, amp3=3, freq3=0.44
// Z: amp1=4, freq1=0.06, amp2=2, freq2=0.18, amp3=1, freq3=0.38
// spinSpeed = 8
// Gentle, controlled. Object is always readable.

Deep Space Satellite (cinematic, epic)


// X: amp1=40, freq1=0.04, amp2=20, freq2=0.11, amp3=8, freq3=0.29
// Y: amp1=35, freq1=0.05, amp2=18, freq2=0.14, amp3=7, freq3=0.33
// Z: amp1=15, freq1=0.03, amp2=8, freq2=0.09, amp3=3, freq3=0.22
// spinSpeed = 3
// Very slow, very wide. Cinematic scale.

Nervous Artifact (glitchy, tense)


// X: amp1=8, freq1=0.6, amp2=15, freq2=1.4, amp3=10, freq3=3.2
// Y: amp1=10, freq1=0.5, amp2=12, freq2=1.1, amp3=8, freq3=2.7
// Z: amp1=5, freq1=0.8, amp2=8, freq2=1.8, amp3=6, freq3=4.1
// spinSpeed = 0
// Fast, jittery. Secondary waves dominate. Unstable feel.

Underwater Object (submerged, heavy)


// X: amp1=20, freq1=0.07, amp2=10, freq2=0.19, amp3=4, freq3=0.41
// Y: amp1=25, freq1=0.06, amp2=12, freq2=0.16, amp3=5, freq3=0.35
// Z: amp1=10, freq1=0.05, amp2=5, freq2=0.13, amp3=2, freq3=0.28
// spinSpeed = 2
// Slow, wide arcs. Feels like water resistance.

Triggered Variant (Drift That Starts From an Event)


To make the drift fade in gradually from a stationary state, multiply the entire drift by a ramp-up
envelope:
// === GYROSCOPIC DRIFT WITH FADE-IN — X Rotation ===
amp1 = 25; freq1 = 0.15;

Page 12
After Effects Expression Guide

amp2 = 12; freq2 = 0.37;


amp3 = 5; freq3 = 0.71;
startTime = 2.0;
rampDur = 3.0; // seconds to reach full drift

t = time - startTime;

if (t < 0) {
value;
} else {
// Smooth ramp from 0 to 1 over rampDur
ramp = clamp(t / rampDur, 0, 1);
ramp = ramp * ramp * (3 - 2 * ramp); // smoothstep

drift = amp1 * [Link](freq1 * t * [Link] * 2)


+ amp2 * [Link](freq2 * t * [Link] * 2)
+ amp3 * [Link](freq3 * t * [Link] * 2);

value + drift * ramp;


}

The ramp envelope is 0 at the start time and smoothly reaches 1 after rampDur seconds. During
the ramp, the drift amplitude gradually increases from nothing to full strength. This creates a
seamless transition from stillness to motion — the object appears to be slowly caught by an
invisible current.

Page 13
After Effects Expression Guide

Comparison and When to Use Each

Both expressions animate 3D rotation, but they occupy opposite ends of the motion spectrum.
The Orbital Tumble is unbounded continuous rotation (the object spins forever); the Gyroscopic
Drift is bounded oscillation (the object rocks within a range). The choice depends on whether
you want kinetic energy or ambient presence.

Aspect Orbital Tumble Gyroscopic Drift


Motion type Continuous full rotation Bounded oscillation
Range Infinite (spins forever) Limited (rocks within range)
Readability Low (object constantly turning) High (object mostly faces camera)
Complexity source Irrational speed ratios Layered sine harmonics
Math model Linear rotation + ratios Additive synthesis
Physics feel Zero gravity / space Fluid / underwater / air current
Best for Debris, abstract, transitions Product shots, hero elements, titles
Parameters per axis 2 (speed + ratio) 6–7 (3 amp/freq pairs + spin)
Can stop naturally Yes (damped variant) Yes (ramp envelope)
Looping Quasiperiodic (never exact) Quasiperiodic (never exact)

Combining Both
A compelling technique is to use the Orbital Tumble for background elements (floating shapes,
particles, abstract geometry) while reserving the Gyroscopic Drift for the foreground hero
element (a product, a title card, a logo). The tumbling background conveys energy and motion,
while the drifting foreground stays readable and elegant. The contrast in rotational character
creates visual hierarchy without any additional effort.
You can also sequence them on the same object: start with a fast Orbital Tumble (the object is
thrown into frame, spinning chaotically), then use the damped variant to slow it down, and finally
cross-fade into the Gyroscopic Drift for a gentle ambient hold. This three-act structure turns a
simple 3D rotation into a narrative moment.

Essential Tips for 3D Rotation


• Always enable 3D on the layer before applying these expressions. Without it, X Rotation
and Y Rotation properties do not exist.

Page 14
After Effects Expression Guide

• Add a camera to the composition (50mm is a good default). Without a camera, 3D


rotation renders in orthographic projection, which removes perspective and makes the
motion look flat.
• If combining with position expressions, set the layer’s Anchor Point to its visual center.
Off-center anchors cause the object to orbit its anchor during rotation, which may or may
not be desired.
• For text layers, enable Per-Character 3D in the text animator for individual letter
tumbling. Apply these expressions to the animator’s rotation properties instead of the
layer’s.
• All expressions use value + to preserve manual rotation offsets. Set a starting
orientation by hand and the expression builds on top of it.
• Motion blur (enable on the layer and in composition settings) dramatically improves the
realism of 3D rotation, especially at higher speeds. Without it, fast tumbles look strobed.

End of Guide

Page 15

You might also like