Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects A couple 3D layer – camera facing expression questions.

  • A couple 3D layer – camera facing expression questions.

    Posted by Mehmet Akten on September 4, 2007 at 3:21 pm

    Hi all, there are 2 expressions that I need, maybe if I sat down with pen and paper I could figure them out but I would have to dig out my trigonometry books, and I’m sure these expressions are out there somewhere so no point re-inventing the wheel!

    1. I want a layer to always be PARALLEL to the camera. The Auto-orient option always POINTS the layer to the camera, so if the camera is quite close and zoomed in on the layer to one side, it will rotate and distort heavily. What I want is for the layer to always be flat towards the camera (called camera-facing in many circles).

    2. I want a layer to always be parallel to the camera (same as above) but only turning around its Y axis, so its always perpendicular to the floor, but its X axis is parallel to the camera plane. Again, not POINTING to the camera otherwise it will be distorted and not flat if the camera is zoomed in on one side.

    I’ve searched the web and found almost similar solutions, but they always involved linking the camera and 3D layers to the same null and rotating the null to control camera rotation etc… but that will not work for me as my camera animations are quite complex and exported from cinema4D or 3DSMax. The camera orientation and rotation values are all zero, and the full motion is controlled by the camera position and anchor point – to convert that to the null parented system is out of the question! A simple copy/paste of an expression on the desired 3D layers is the best solution for me.

    I’m surprised I havent found these expressions anywhere as they seem quite vital to do various kinds of 3D comping! Any feedback welcome,

    cheers,

    Mehmet Akten replied 18 years, 12 months ago 2 Members · 3 Replies
  • 3 Replies
  • Mehmet Akten

    September 4, 2007 at 5:28 pm

    well Im quite happy to say that I got the 2nd expression (the way simpler one) working.

    The Concept is similar to Dans auto-orient Y-only. Except it doesnt point the layer to the camera (you get distortion if you get close to the layer with auto-orient methods) – it keeps it parallel.
    Code is below, I am a total AFX expressions newbie, so there may be easier ways of writing this, if so please lemme know.

    (paste to Y rotation)
    camDir = normalize( thisComp.activeCamera.transform.position – thisComp.activeCamera.transform.pointOfInterest );
    camX = normalize( cross(camDir, [0,1,0]) );
    radiansToDegrees(Math.atan2(-camX[2],camX[0]));

    I’ve started thinking about the first question (full camera facing), if anyone gets it before I do please post it and save me the headache!!

  • Roland R. kahlenberg

    September 4, 2007 at 6:06 pm

    Yes, I noticed that auto-orient Y-only distorts the layer. What you want sounds like a 3D layer behaving very much like a 2D layer. This sounds like something layer space transformations should handle, possibly with some other kungfu scripting bits thrown into the fray.

    Have you posted at the COW’s AE Expressions Forum?

    Cheers
    Roland Kahlenberg
    https://www.broadcastGEMs.com – Adobe After Effects project files
    https://www.myspace.com/rorkrgbspace

  • Mehmet Akten

    September 4, 2007 at 6:37 pm

    Hiya, I am much closer to a solution (in fact I got something that works for me now). I hadnt noticed that there was a seperate container for expressions so I’ve carried this thread there as it is probably more suitable.
    https://forums.creativecow.net/readpost/227/8478

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