21 Replies Latest reply on Jun 21, 2016 5:29 AM by Szalam

    How to rotate a 3D object about an arbitrary axis in 3D space?

    wideEyedPupil Level 1

      I want to be able to rotate a 3D shape drawn in AE (or imported artwork from AI converted to a shape) about one of it's edges. I think it's easiest to explain with an animation so here is a simple example file and movie of two triangle shapes rotating in 3D space one after the other.

       

      The first rotation is easy as I can move the object anchor to align with the left most edge of the triangle which is also parallel to the Y axis, then just rotate it 180º about Y-Axis over a 9 frame period.

       

      The second rotation is required about an edge which is neither parallel to the X, Y or Z axis. So although by rotating it 180º through the X-Axis and 60º through the Z-Axis over a 9 frame period, the effect of the rotation is not the desired edge flipping look achieved in the first animation. In order to do it I either need some kind of parent object hierarchy where I can rotate the the triangle.

       

      I feel like I need to arbitrarily rotate the triangle comp (say by Vector A) to line it up with an X,Y or Z axis then animate the rotate transition over time around one of those axes and then rotate the whole thing back by A' to be ion the correct location for the rest of the objects. Like how to do a matrix rotate one would translate the object to be located over the origin point, rotate it and then translate it back to original position so it's a rotation relative to object origin not world space origin. Don't know how to perform this in AE.

       

       

      proper rotation axis for first triangle:

      Screenshot 2016-05-25 13.42.33.png

       

      double rotation axes for second triangle needed due to fixed orientation of local object space (consonantly looks wrong):
      Screenshot 2016-05-25 13.37.33.png