Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects calculating a vector to angle with expressions

  • calculating a vector to angle with expressions

    Posted by Clemensk on May 14, 2006 at 10:33 pm

    Hi

    I want to make a background for an animation with the cc sphere effect. to make things more complicated i want to connect the camera rotation with the rotation parameters of the cc sphere effect. I used point of interest to animate the rotation it o I need a script to calculate the rotation. Here’s my try. (Its not working properly):

    x =thisComp.layer(“Kamera 1”).transform.pointOfInterest[0] – thisComp.layer(“Kamera 1”).position[0];
    y =thisComp.layer(“Kamera 1”).transform.pointOfInterest[1] – thisComp.layer(“Kamera 1”).position[1];
    z =thisComp.layer(“Kamera 1”).transform.pointOfInterest[2] – thisComp.layer(“Kamera 1”).position[2];

    wx = radiansToDegrees(Math.atan2(y, z));
    wy = radiansToDegrees(Math.atan2(x, z));
    wz = radiansToDegrees(Math.atan2(x, y));

    [wx,wy,wz]

    It would also be nice if the background would react to the camera movement.
    It doesn’t have to be realistic just to add some depth

    Any ideas?

    with best regards

    Clemens

    Clemensk replied 20 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Nicholas Toth

    May 15, 2006 at 1:58 pm

    Why don’t you parent the camera to a null and then use the null’s rotation as a direct expression to the cc sphere?
    It should work, and it’ll be MUCH less complicated.

  • Clemensk

    May 15, 2006 at 3:54 pm

    I already tried this but it doesn’t work. Parameters keep constant on the Null-Layer.

  • Clemensk

    May 15, 2006 at 11:40 pm

    yes. i’m aware of this. It’s just for some abstract background. I’m using the inside option so it looks like you’re inside the sphere.

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