Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions CC Sphere rotation expression to follow camera with auto-orient

  • CC Sphere rotation expression to follow camera with auto-orient

    Posted by Jason Hare on December 30, 2009 at 4:44 pm

    Hi All,

    I am wondering if any one can offer help with an expression to link the rotation fields on CC Sphere with the camera location when using auto orient.

    I have created a simple ball using a flattened texture. I am using CC SPhere to make this ball look 3D and hve set auto-orient so it keeps the 3D appearance when the camera moves. My only problem is that as the camera moves around the ball it just looks like the ball turns to face the camera, when you should be able to see a different part of the ball as the camera flies round.

    I assume this could be done with an expression on the rotate fields of the CC Sphere, but I am not sure what they would be linked to.

    Any suggestions?

    Jason Hare replied 16 years, 4 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    December 30, 2009 at 10:57 pm

    Try leaving it 2D (no auto orient) and use these:

    // x rotation:

    value + lookAt(thisComp.activeCamera.position,position)[0]

    // y rotation:

    value + lookAt(thisComp.activeCamera.position,position)[1]

    // z rotation:

    value + lookAt(thisComp.activeCamera.position,position)[2]

    I think Lord Scales originally posted these some time back. They seem to work very well.

    Dan

  • Marko Ivezic

    December 31, 2009 at 8:23 am

    If null is parented to camera this wont work. How to make it right in that situation?

  • Dan Ebberts

    December 31, 2009 at 7:28 pm

    Try this for x rotation:

    value + lookAt(thisComp.activeCamera.toWorld([0,0,0]),position)[0]

    You can work out the others… 🙂

    Dan

  • Jason Hare

    January 3, 2010 at 9:48 pm

    Hey Dan,

    Thanks so much for this tip. It worked a treat. The ball rolls into the 3D set and as the camera flies through it looks perfect. I have left auto orient on though as it seems to work.

    Thanks again

    Jason

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