hi I'm Ben Marriott I make weekly motion design and animation
tutorials and today I'm going to talk through how to animate that impossible
triangle all from 2d shapes in After Effects let's begin
first of all I created the shape in Illustrator after tracing over some of
reference photos and all three components were duplicates of the same
shape that I just rotated 120 degrees because it was important they all lined
up exactly otherwise would run into a lot of trouble in the animation
I imported that file into After Effects by selecting file import finding it and
importing it as composition to retain layer sizes
let's name that triangle main so with this triangle main layer I'm going to
duplicate triangle 3 with ctrl D bring that up to the top and I'm gonna right
click that create shapes from vector layers and that just turns this layer
into a shape that I can edit with my pen tool here I was gonna precomp these
layers below and just call them triangle ref and lower the transparency on that so I
can use that as a reference layer although our background which black here
if we toggle our transparency grid you can see that it's all transparent and
it's only this shape here that is fully opaque I'm also going to change this
color shape fill to a nice bright pink so it can clearly tell the difference
between them in the background and let's right rename this shape segment 1 because
we've always labeled our layers now I want our current segment 1 to transform
into this next shape which is the gray section of our triangle that we've got
here so let's toggle down in a panel down here our contents our group our path
and let's keyframe the path here at about 20 frames in we want it to be
transformed into this next shape I think it's useful here to only focus on one
section of this animation at a time because thinking about the actual
physics of the shape would get quite painful after a while we're just gonna
take this sort of bottom sort of area here and imagine we're working with just
a rectangular prism that would be rotating along one axis sort of like a
rotisserie chicken so our outside edge here it's gonna stay in its same place
and an inside edge here it's gonna sort of drift closer and sort of disappear as
this sort of edge is gonna start turning away and facing away from us so let's
move these points of this shape layer to get roughly where we want let's roughly
take a look there we are it's kind of like what we want it's not perfect but
let's do the other sections and come back to tweak the details later so it's
good to throw down some rough keyframes to quickly tell whether the overall
animation will work rather than spending time to get it perfect and then figuring
out that it won't later on and it's very tempting because that's
the fun part with all the glory getting the timing and the easings of every
keyframes to be exact but it's good practice to get comfortable with your
animation looking a bit crap for a while before it starts looking good so this
next slide here is going to go up and fill this position of this longer edge
here so let's drag these keyframes up here and take a look what we've got now
we've run into a problem here where if we want to move this sort of point on
that shape layer it's gonna drag up our shape and sort of cross paths here and
it's gonna mess up the animation that we've got down below what's that that's
not what we want but the way we can fix that
is if we add another keyframe here and then drag that down here to act as that
corner point now if we watch that back that's kind of get in there exactly move
this keyframe a lot closer it's going far too slow much better let's zoom in
here alright that's looking pretty close now we need to animate this side here that
needs to come into existence from nothing and fill up this shape so this
bottom side here leaves a frame this one has to sort of come into existence so
we're gonna do that by adding another shape down to the shape layer so let's
zoom in real close and it's gonna draw the shape by clicking four times and
creating a little quadrilateral here it's got a stroke on which we don't want
so I'm just gonna alt click a stroke until there's no stroke on there and let's
adjust these points they line up by a reference layer all right and that's
keyframe that shapes path and then at the very beginning of the animation we
want this to be reduced to nothing so we're gonna move those anchor points
down here so it's very very small and then nothing at all yeah that's in a
good place for a rough now let's go in and tweak the positions of these points
just so they all line up and we don't get any of these jagged stepping motions
in between the animation
alright that's great
alright let's trim this shape layer down to our keyframe here by pressing alt]
dragging it to the very last frame and we're gonna just
pre-comp this by pressing ctrl shift C I'm gonna call this trisegement
I precomp this because this will be a base building block for
animation so if we need to make any adjustments to it later having it in a
single pre-comp will make it a lot easier than adjusting lots of shape layers
throughout the animation we may not need to but just in case it's good to have
now I'm going to duplicate this twice with a control command D I'm going to
drag them into a sequence so they play one after each other there we go we want
the second composition to continue our animation from its previous
position so I'm going to rotate this minus 120 degrees so I'm going to press
R to bring up a rotation type in minus 120 and now I'm gonna move it to line it
up without reference layer we have a tiny chunk as we cut between them but we
can nudge this shape a little bit with our arrow tools into position and get it
to line up a lot smoother there that's much better and now a third one we're
gonna rotate this one minus 240 degrees all right now we've got a nice looking
loop here I did try while I was making this trying to move
the anchor point of this composition into the exact center of the triangle so
we'll have to nudge and adjust it so much but nothing really worked
reposition anchor point tools and plugins won't work because the center of
an equilateral triangle is not the center of the bounding box that the
shape makes so going out of the old-fashioned way like a granddad's used
to with the arrow keys and elbow grease was the most effective way that I found
please let me know in the comments if you can find another solution rather
than just this constant nudging now let's pre-comp all of these with
control shift C and call them trisegment-looped
now let's duplicate that two more times with control D now let's
rotate these and fill in the rest of the triangle already this first one - 120
degrees again drag that into place and rotate this top one - 240 place that
there and do some good old-fashioned nudging to get them roughly into place
and play that back, ehh nothing is happening we can see a few of the gaps
appearing inside our triangle so let's address that but first we're going to
add a fill effect to these shapes I'm just I can fill up here it's like the
fill tool and I'm going to select a color palette I made previously in
Illustrator up here in our project window and I'm just gonna eye drop some colors from that
let's change that background color as well from black to
this nice yellow now let's play it back and look what glory we've created all
right okay now in this second rotation you can see our shapes aren't quite
properly aligned and we get this yellow line which is that visible background in
between these shapes and then on our third one we've got a little gap here as
well say just that we could go into a composition and nudge this section a
little to the left and little to the top but we're kind of flying blind and
when we go back into a comp we can't really see how much of what her adjusted
has made a difference now a great way to see both at the same time is with this
top comp open I'm gonna toggle viewer lock up here which means this comp will
always be visible in this window and then if I click inside into this pre
comp it opens up a pre comp in a timeline and that composition window up
here but we've still got our triangle main option up here as well so we can
simply drag that out to our right here and now we can see both comps at the
same time so now we can move elements of this composition here and see how it
affects the top compositions that it's nested in so if we go and drag this
wildly you can see how it affects the top come here
so let's undo those so let's nudge this to get all these lines to line up here
so let's nudge just the right touch and we're kind of closing this gap here as
we do that I'm also opening up this gap and let's nudge that to the left
I'm just trying random Keys until it kind of lines up I don't to go too far
because then it's gonna open up other gaps in other places so I'm gonna get it
to where it's this close it can get it does look like there's
gonna be some slight gaps here regardless so one thing we can do is in
this comp at each of these layers I'm gonna add the effect simple choker and
set the choke matte to minus 1 which will just slightly expand this shape I'm just
gonna copy that to both of these layers as well and that just means that each
one is going to be like one pixel thicker essentially and they'll cover up
any sort of gaps and errors that we've got in this cop here now let's unlink this
comp here and let's close one of them and let's get back into our triangle
main comp now if we play it back that loops nicely let me know down in the
comments of looping animations or something you'd like to learn more about
and some more techniques I have for how to get things to loop seamlessly now one
thing that I'm noticing while looking back at this loop is that the corners
still don't feel quite right to me it it looks as though this shape is kind
of just filling in the shape that this one left by rather than actually
rotating so we go in and edit that and we can go in by just going in and
nesting down into our original pre comp here and this is exactly the reason why
we pre comp this in the first place so we can make adjustments to this one pre
comp and it will affect all the others and I think it's because this anchor
point here or this point in a shape tool it sort of just remains in this one
position throughout the whole animation I think over here in the beginning it
needs to line up with this shape here so let's zoom right in and it's gonna be
difficult to grab the right shape because we've got two points on top of
one another let's give one a go and hope that was the right
one like it was all right good and let's drag that over I'm gonna hold shift as I
pull it across too so it doesn't vary on any other axis except the horizontal one
and I'm going to try to line it up to where this sort of point meets here
let's play that back okay that's looking all right I think now we
can just tab back up and see what it looks like in the main animation
I think that's looking better but one thing that I
not quite sure now one thing I don't like to look up is this rest of the
triangle here that point should be pulling down as well so let's go in and
adjust that too and that's this corner point so let's we want to drag this
anchor point over to the right as we get to the end here there we are that's
looking much better and that's looking more like a natural rotation even though
it's a weird impossible shape and to add some more flavor to this animation let's
make this whole shape rotate so to do that I'm going to create a new null
object layer new null and rename that no and we want to place that in the middle
of this equilateral triangle now we can eyeball it where the roughly the middle
will be and that would probably be fine but if you do want to get a lot closer
what we can do is grab an ellipse tool draw a circle unless take the circles
transparency down because we're just going to use this as a guide and place that roughly
in the middle I'm gonna reduce its scale because I just wanted to nudge the edges
here and with that in the middle control r to bring our rulers up and we're
gonna drag our ruler until it lines up with these dots here and those dots here
and now we can see that the center of this triangle is a little bit more the
top so with that null in there in the middle and delet the shape layer let's select our
try segments loops parent those the null object with the pick whip gonna press R
on my keyboard and on the first frame keeping the rotation and then at the end
here let's keyframe it one full rotation let's play that back now that's going
way too fast but we still want a full rotation so it'll loop seamlessly so
we're going to extend our tri segments looped comps so let's select into our tri
segment loop comps press ctrl K to bring up our composition settings and let's
just double the duration to four seconds 24 zoom out and let's just just
duplicate all these layers with ctrl d all these comps rubber and then slide
these over into a sequence so essentially that comp is just looping twice let's go back
into our top layer and let's drag this rotation keyframe over
and now our rotation should happen twice as slow we notice it does get a lot
closer to the bottom of the composition than the top of the conversation up here
so if you just nudge that up adjust that so it feels reasonably centered I've got
three textures that I want to add to this animation to give it a bit more bit
more flavor so there are my assets folder textures
and we've got dimples cardboard which we're gonna drag down to the bottom and
we're gonna make this our background layer and I'm gonna add a curves effect to
increase the contrast to make it really black and white there we go
and I'm gonna add a tint effect so I can remap the black and white values and I'm
gonna use palettes for that so now white is mapped to this yellow
and our black is mapped to this blue color now that texture is going a bit too
far that's a bit too hectic so let's right-click dimple cardboard go to time
time stretch and we'll change it from 100 to 200 and let's plays back a nice bit
slower let's drop a light texture on top as well this is a texture that I always
use and I'm gonna change its mode to screen that just gives us these white
little speckles it'll pop up throughout our composition and one more which is
this tarmac texture here I'm gonna scale that down and I'm going to use the set
matte effect to matte out one of the areas of the triangle so we're gonna take the
matte from layer let's say number four now at the moment our matte isn't really
working at all and what we need to do is click this thing down here which
continuously rasterize atomic - and we all that also need to have that selected
for our triangles as well so now you will line up now for the wrong triangle
selected so let's select another one that's the one we want and let's recolor
that with the tint effect as well and let's parent this comp to this rotation
null as well so it'll move with that triangle and one last thing is I'm gonna
create a new adjustment layer control of Y and add the posterized time effect and
change the frame rate down to 12 this will make the whole thing animated 12
frames per second now look a lot choppier than we're used to seeing and
this is just a personal stylistic choice I love things being animated on tools
especially when I got so much textures and it just makes things look a
little less sort of you know super digital and computery
which is really pronounced when you've got this sort of impossible morphing
shape here so it looks a lot smoother without this effect but I really dig the
choppiness here you can download this project file down in the description if
you use any techniques you've learned in this video in your own work please tag
me on instagram @ ben_marriott_ so i can check out your work
i can't wait to see it please let me know down in the comments
what else you'd like to see in this channel if you enjoyed this video please
consider subscribing don't forget to hit that Bell icon like share and check out
this playlist of related videos I'll see you in the next one
subtitle: Zoe J Marriott