ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Animate position in isometric 2D space

FAQ   •   VIEW ALL
 Animate position in isometric 2D space by Chris Voon Aug 20, 2015 at 9:08:11 pm

Hi All,

I have an isometric project that will require a lot of position animation -- is there a technique to quickly and accurately animate my position movements along my isometric grid? For example when you hold shift, it constrains your movement linear x and y -- can you do something similar along 30degrees/150degrees (any degree).

Currently I've overlaid my isometric grid in my comp and eyeballing it but I'm curious if there's a more precise/systematic way of doing it.

Thanks,

 Re: Animate position in isometric 2D spaceon Aug 21, 2015 at 7:56:17 amLast Edited By Kalle Kannisto on Aug 21, 2015 at 7:57:45 am

Here's how you could do it for 30 degree isometric:

Make a precomp that is a square, about 1.5 times the longer dimension of your final comp. Put your isometric elements inside the precomp and scale each of your original elements to 173,2% (square root of 3 times 100%) on the y axis, then rotate them 45%.

In your main comp, add two separate Transform effects to your precomp, the first one to rotate the comp -45 degrees, the second one to scale the height to 57,7% (1 divided by square root of 3 times 100%).

Now you can drag anything inside the precomp x and y axis and it will become the 30/150 degree isometric axis in main comp.

 Re: Animate position in isometric 2D spaceon Aug 21, 2015 at 10:57:10 am

Position a 2D layer which you'd like to move over the isometric grid in the center of your origin tile.

Add a Point Control effect to the layer and name it "Grid Position".

Add a Slider Control effect and name it "Tile Width". Measure the width of your isometric tile in pixels and adjust this slider accordingly.

Add a Slider Control effect and name it "Tile Height". Measure the height of your isometric tile in pixels and adjust this slider accordingly.

Alt+click the position stopwatch and enter the following expression:
```xGrid = effect("Grid Position")("Point")[0]; yGrid = effect("Grid Position")("Point")[1]; x = (xGrid - yGrid) * effect("Tile Width")("Slider")/2; y = (xGrid + yGrid) * effect("Tile Height")("Slider")/2; value + [x,y]```

You can now use the Grid Position effect to address the screen in tile units.

 Re: Animate position in isometric 2D spaceon Aug 21, 2015 at 12:58:03 pm

@Walter: Nice!