Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects expression to cull back-facing 3d layers

  • expression to cull back-facing 3d layers

    Posted by Kerovisuals on October 12, 2005 at 8:59 am

    Im sure this is fairly simple, but my knowledge of expressions is very limited. I have a 3d layer that orbits around a 2D globe and need it to be hidden when it appears “behind” the globe (technically it isnt behind, as the globe has no z-depth). i cant make the globe layer 3d, so is there an expression i can add to hide (either through opacity or visiblity) the orbiting layer when it is turned away from the camera? i believe the equivelant in 3D packages is called “cull back-facing planes”.

    Dan Ebberts replied 20 years, 7 months ago 3 Members · 3 Replies
  • 3 Replies
  • Mylenium

    October 12, 2005 at 9:47 am

    This is some code from Dan Ebberts that should do the trick:

    a = toWorldVec([0,0,1]);
    b = thisComp.layer(“Camera 1”).position – toWorld(anchor_point);
    c = dot(a,b)/length(b);
    if (c > 0) 0 else 100

    Apply it to the opacity parameter.

    Mylenium

    [Pour Myl

  • Kerovisuals

    October 12, 2005 at 10:26 am

    thanks mylenium – works like a charm.
    and thanks to dan as well – discovering his motionscript site has just opened up a world of learning to me!

  • Dan Ebberts

    October 12, 2005 at 10:51 am

    Hey guys, for future reference, this one does the same thing more efficiently:

    if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

    Dan

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