Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Only show an object when the camera is within 45 degrees of it?

  • Only show an object when the camera is within 45 degrees of it?

    Posted by Unit_9 on September 15, 2007 at 12:44 am

    Hi all, 🙂

    I want to fade in a series of images when the camera is within 45 degrees of facing them. I’d also like it to fade-in the image the closer you are to facing them – so 45 degrees away or more would be 0% alpha and 0 degrees (directly facing the image) would be 100% alpha.

    Can anyone help me with this??

    Dan Ebberts replied 18 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 15, 2007 at 4:10 am

    This should do the trick:

    C = thisComp.activeCamera;
    v1 = toWorldVec([0,0,-1]);
    v2 = normalize(C.toWorld([0,0,0]) – toWorld(anchorPoint));
    angle = radiansToDegrees(Math.acos(dot(v1,v2)));
    linear(angle,0,45,100,0)

    Dan

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