Creating a rotating 3D console or card carousel is a staple in modern UI motion graphics. But manually animating the scale, position, and color of every single card as it moves to the front is a tedious process. In this tutorial, we will build a fully automated 3D Carousel using After Effects Expressions.
We will rig a 3D circle of cards parented to a single Null Object. Then, using two powerful expressions linked to an Active Camera's Depth of Field, the front card will automatically scale up and appear in full color, while the background cards dynamically shrink, blur, and turn black & white.
First, create your main composition (1920x1080). Then, create a separate "Card" composition (e.g., 500x673) and drop your image inside. Fit the image to the comp, create a rectangle mask with a roundness of 25, and apply it so the card looks polished.
Bring the Card comp into the Main comp. Add a Null Object, name it Card Controller, and make both layers 3D.
Change your view to Top View. Move the Card Controller backward in Z-space (behind the card). Go back to Active Camera, parent the Card to the Card Controller, and turn on Auto-Orient Towards Camera (Right-Click -> Transform -> Auto-Orient). Now, when you rotate the Controller's Y-axis, the card swings in a wide arc but always faces you.
We need 5 total copies of the card. A full circle is 360 degrees. If we divide 360 by 5, we get 72 degrees.
We want the card closest to the camera to be the largest. Create a 3D Camera and enable Depth of Field (set Aperture to 700 so the background blurs heavily). Now, Alt-click the Scale stopwatch on a card and paste this expression:
cam = thisComp.activeCamera;
// Distance from camera
d = length(toWorld(anchorPoint), cam.toWorld([0,0,0]));
// Camera focus distance
fd = cam.focusDistance;
// How wide the focus area is (adjust this)
range = 300;
// Scale values
minScale = 90;
maxScale = 140;
// Calculate how close to focus
diff = Math.abs(d - fd);
// Map the values
s = ease(diff, 0, range, maxScale, minScale);
[s, s, s]
How it works: The expression measures the distance between the card and the camera's focus distance. If it is in focus, it scales to 140%. If it moves away, it eases down to 90%. Right-click this Scale property, select "Copy Expression Only", and paste it to all other cards.
To make the out-of-focus background cards turn black and white, select all cards and apply the Tint effect. We will map the "Amount to Tint" property using the same camera math.
Alt-click the "Amount to Tint" stopwatch and paste this expression:
cam = thisComp.activeCamera;
// Distance from camera
d = length(toWorld(anchorPoint), cam.toWorld([0,0,0]));
// Focus distance
fd = cam.focusDistance;
// Focus range (adjust this)
range = 300;
// Calculate difference from focus
diff = Math.abs(d - fd);
// Map opacity
minO = 0; // Front (in focus, 0% tint)
maxO = 100; // Back (out of focus, 100% tint)
ease(diff, 0, range, minO, maxO);
Now, whenever you rotate the Y-Rotation of the Null Controller, the cards will automatically spin into place, pop up in scale, regain their full color, and come into crisp camera focus — all simultaneously, without a single manual keyframe on the cards themselves!
If you want to speed up your workflow using expressions, smart rigging, and professional UI/UX animation techniques, join our community.
Subscribe to Infizy Academy
Discussion (0)
Leave a Reply
No comments yet. Be the first to start the discussion!