Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects After Effects 3D Position only rotate

  • After Effects 3D Position only rotate

    Posted by Jim Johnston on January 28, 2017 at 3:29 pm

    Hi all,
    trying to figure out a way to rotate layers around an axis in 3d without the actual layer itself rotating, but only taking in positional data from a null. Is there a way to do this? I guess I need to bake the positional data of the 3d null out from the rotation attribute so I can use it to parent the layer.

    Imagine a solar system and I need to rotate flat planets around a sun in 3D so the faces of the planets are always facing the camera.

    Any hints will be appreciated.

    Thanks!

    Jim Johnston replied 9 years, 3 months ago 2 Members · 4 Replies
  • 4 Replies
  • Roei Tzoref

    January 28, 2017 at 4:21 pm

    apply this expression to the rotation property of your layer:
    -parent.rotation

    now the layer will not take into account the parented rotation information.

    Roei Tzoref
    After Effects Artist & Instructor
    ♫ Ae Blues Tutorials

  • Jim Johnston

    January 28, 2017 at 4:38 pm

    Thanks very simple, just invert the parameter!

    I used:
    -parent.transform.xRotation

    Cheers

    ~~~~~~~~~~~~~~~~~~~~~~
    △ As Above | So Below ▽

  • Jim Johnston

    January 28, 2017 at 7:29 pm

    Ok, when I try rotating more than one axis, this technique falls apart. Just inverting the rotation against the null doesn’t seem to work.. I guess the math isnt right!

    Any ideas?

    Cheers

  • Jim Johnston

    January 28, 2017 at 9:53 pm

    Fantastic, found this incredible post here

    https://forums.creativecow.net/thread/227/24188#27547

    Apply this expression to your orientation and it will nullify any 3D rotation inherited from the parent.

    Not entirely sure how it works though!

    u = fromWorldVec([1,0,0]);
    v = fromWorldVec([0,1,0]);
    w = fromWorldVec([0,0,1]);

    sinb = clamp(w[0],-1,1);
    b = Math.asin(sinb);
    cosb = Math.cos(b);
    if (Math.abs(cosb) > .0005){
    c = -Math.atan2(v[0],u[0]);
    a = -Math.atan2(w[1],w[2]);
    }else{
    a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]);
    c = 0;
    }
    [radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]

    credit to Dan Ebberts

    Cheers

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