Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects expression for 3D orientation

  • expression for 3D orientation

    Posted by Ryan Chan on July 6, 2006 at 7:04 pm

    hello guys, i have read the case study from Dan Ebberts for 2D orientation, it is very useful. and did anybody know if we can also be able to get the information/data from 3D orientation? with and without considering the camera’s position(camera work). thanks

    Dan Ebberts replied 20 years, 1 month ago 4 Members · 6 Replies
  • 6 Replies
  • Mylenium

    July 6, 2006 at 7:51 pm

    Use the lookAt() method. It does basically the same as orientation parameters.

    Mylenium

    [Pour Myl

  • Ryan Chan

    July 6, 2006 at 8:29 pm

    sorry, what i mean is, can i extract the value from the 3D Auto orientation, so i can use it for other reason(layer). thanks

  • Dan Ebberts

    July 6, 2006 at 8:53 pm

    Try this:

    L = this_comp.layer(“Layer 1”);
    s = L.scale/100;
    u = L.to_world_vec([s[0],0,0]);
    v = L.to_world_vec([0,s[1],0]);
    w = L.to_world_vec([0,0,s[2]]);
    sinb = clamp(w[0],-1,1);
    b = Math.asin(sinb/this_comp.pixel_aspect);
    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 = Math.atan2(u[1],v[1]);
    c = 0;
    }
    [radians_to_degrees(a),radians_to_degrees(b),radians_to_degrees(c)]

    Substitute your layer for “Layer 1”.

    Dan

  • Ryan Chan

    July 6, 2006 at 9:16 pm

    thanks so much, Dan

  • Filip Vandueren

    July 7, 2006 at 1:11 am

    Hi Dan,

    I can’t test this for the moment,
    but would this expression sum up all the rotations for e.g.
    a camera that is Auto-oriented + keyframed for rotation + keyframed for orientation ?

    if so: brilliant stuff, just what I needed for a problem I was working on 😎

    on a related note: do you think it is feasible in Javascript to convert an After Effects style 3D Euler rotation to a VRML-style axis+angle rotation ?

  • Dan Ebberts

    July 7, 2006 at 1:51 am

    >would this expression sum up all the rotations

    It seems to. Except possibly in a gimbal lock situation.

    >if so: brilliant stuff

    Thanks! 🙂

    >do you think it is feasible in Javascript to convert an After Effects style 3D Euler rotation to a VRML-style axis+angle rotation ?

    I’m not that familiar with VRML, but it seems like it should just be a matter of cooking up the right transform.

    Dan

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