Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Dimetric Shapes – How do I create “Diagonal/Z-axis” motion?

  • Dimetric Shapes – How do I create “Diagonal/Z-axis” motion?

    Posted by Hafeez Zainalabidin on August 8, 2018 at 11:11 am

    Hey fellas,

    I’m relatively new to After Effects (4 years on and off, mostly freelance stuff) and new to expressions in general. So I have a dimetric object that I created using regular shape layers and adjusted using the SSR (Scale, Skew, Rotate) method. For the purposes of this post let’s assume that it’s a regular cube in dimetric view.

    I’m automating the object such that the height, width and depth of the object can be controlled by a null. I modified the expressions used in this video (since I’m creating a dimetric and not a true isometric object, so it’s a 20 degree skew from the horizontal axis) : Video here But instead of having the point of origin in the bottom vertex like in the video, I changed it such that the object “grows” from the lower left corner vertex of the object. This way, in theory the object should be able to extend positively on the dimetric “Z-axis” instead of negatively like in the video.

    So what I’ve managed to achieve is to control the extrusions of the Left and Top faces of the cube on all the axes (Height, Width and Depth) , but I’m having a problem with the Right face. It grows fine vertically, but I can’t seem to find a way to get it to move diagonally along that Z space at the same rate as the growth of the top and left faces.

    I probably should provide screenshots or a project for reference but I’m not at work. But if you managed to understand everything I’ve said above, any help would be appreciated. I’m splitting hairs over here trying to figure this out!

    Hafeez Zainalabidin replied 7 years, 9 months ago 2 Members · 5 Replies
  • 5 Replies
  • Kalleheikki Kannisto

    August 8, 2018 at 5:09 pm

    Yes, having the project file with one cube like you have it set up currently would be the best starting point. Otherwise we’ll be stabbing in the dark.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Hafeez Zainalabidin

    August 9, 2018 at 6:46 am

    [Kalleheikki Kannisto] “Yes, having the project file with one cube like you have it set up currently would be the best starting point. Otherwise we’ll be stabbing in the dark.

    Kalleheikki Kannisto
    Senior Graphic Designer”

    Okay I managed to recreate the cubes from home. The link to the project file is here: Dimetric Cube Test

    The comp appended with “Negative Z-Axis” works just the way I want to, I just need the comp with the “Positive Z-Axis” to work like that but growing positively along the Z instead of negatively, if that makes sense. To achieve that, there needs to be an expression that technically enables the Right face of the cube to move both horizontally and vertically. My guess is that it’s some sort of Math function that makes use of the Pythagoras theorem but I left most of my math knowledge in high school ☹

    Just to be clear, the cube isn’t a 3D object – each of the faces of the cube are 2D layers that are scaled, skewed and rotated to fit a into a ‘cube’ in dimetric view.

  • Hafeez Zainalabidin

    August 9, 2018 at 6:57 am

    Ahhh flubbed the link, here’s the new one: 12622_dimetriccubetest.aep.zip

    For reference, I want to animate the cube like the background bar elements do in this video: Watch video

  • Kalleheikki Kannisto

    August 12, 2018 at 9:23 am

    Use the following for the right face position value:

    z = thisComp.layer("Control").effect("Z Movement")("Slider")-100;
    x = content("Rectangle 1").content("Rectangle Path 1").size[0];
    x = x/2+z;
    y = content("Rectangle 1").content("Rectangle Path 1").size[1];
    y = y/-2+z*.685;
    [x,y];

    Why the multiplier is .685 is unclear to me but that figure works.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Hafeez Zainalabidin

    August 13, 2018 at 1:53 am

    Hey Kalleheikki,

    Appreciate your help with the expression but I’m afraid it wasn’t quite what I was looking for. The right face ends up detaching from whole cube as the slider value increases. I came across one of Dan Ebbert’s posts while trawling through this forum which sort of detailed an expression for diagonal movement. Had a trigonometry brainwave and adapted it as seen below. I put this in the layer’s position property and managed to make it work!

    spd = thisComp.layer(“Iso Control”).effect(“Z Movement”)(“Slider”);
    angle = 20;
    d = spd;
    r = degreesToRadians(angle);
    x = d*Math.cos(r)-93.9692;
    y = d*Math.sin(r)-34.2020;
    value + [x,y];

    Anyway, thanks again for the help!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy