Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expression for objects facing to camera..

  • expression for objects facing to camera..

    Posted by Peter Mezes on February 26, 2009 at 2:54 pm
    vzdAC = (position[0]-anchorPoint[0])*2  +  (position[1]-anchorPoint[1])*2 + (position[2]-anchorPoint[2])*2; 
    
    vzdBC = (thisComp.layer("kamera").position[0] - thisComp.layer("textik").anchorPoint[0])*2 + (thisComp.layer("kamera").position[1] - thisComp.layer("textik").anchorPoint[1])*2 + (thisComp.layer("kamera").position[2] - thisComp.layer("textik").anchorPoint[2])*2; 
    
    vzdAB = (thisComp.layer("kamera").position[0] - thisComp.layer("textik").position[0])*2 + (thisComp.layer("kamera").position[1] - thisComp.layer("textik").position[1])*2 + (thisComp.layer("kamera").position[2] - thisComp.layer("textik").position[2])*2;
    
    radiansToDegrees(Math.cos(((Math.pow(vzdAB,2))+(Math.pow(vzdBC,2))-(Math.pow(vzdBC,2)/(2*vzdAC*vzdAB)))));

    hi.. i found couple of tutorials in here, but i didnt find the answer for me. im trying to make font that are always face to camera, BUT when is camera auto-oriented to its motion path, not to POI.. i have tryied som sinus stuff in there, but im new in this. i have used as the stable point the text layers anchor point. so i know distance between one character and camera position, camera and anchor, character and anchor.
    so i tryed something like this.. but i glue it up by myself so dont laught please.. 🙂

    oh, and the only thing i need to rotate is y-axis..
    thank you very much for any help..
    peter

    and one more oh, – text layer anchor point is still same and its 2x2x2 to preserve that 0 will not be there. and text layer is spread in pozition z = -2000

    Filip Vandueren replied 17 years, 2 months ago 4 Members · 7 Replies
  • 7 Replies
  • Victor Nash

    February 26, 2009 at 8:15 pm
  • Peter Mezes

    February 26, 2009 at 8:28 pm

    hi, thank you.. but i tryed this one already.. i need to camera be oriented by path.. imagine to have camera in the middle of plenty ones and zeros.. and all of them must face to camera position, not to point of interest, or anchor point, so the camera will be big boss in here.. 🙂 im sry for my english, maybe i didnt say it clearly.. 🙂
    or maybe i did something wrong,, so i created font array,, 1010110101 etc,, animator>position>z = – 2000, randomize, ramp up,.. and i need to swim along with camera.. but, from your link i need to have camera still looking to one point(no matter about the position, so you cant turn back, just walk back but look to front), but i need to be free with watching,,

    thank you..
    Peter
    i bet is something simple, that i just missed in settings.. 🙂

  • Dan Ebberts

    February 26, 2009 at 10:58 pm

    Did you try Layer > Transform > Auto Orient > Orient Towards Camera?

  • Filip Vandueren

    February 27, 2009 at 12:21 am
    If I’m understanding you correctly, you want to have auto-orienting on different characters of 1 textlayer, because you used textselectors to create a 3D “text cloud”

    It may be possible to code this using expression text-selectors on X and Z rotation, but really: that’s a Bag of Hurt™.

    I think you’re going to have to split this up in a bunch of layers that are ones and zeros, make a text cloud from those by scattering them in Z, then apply the auto-orient Y only to those.
    Makes more sense to me anyway.

  • Peter Mezes

    February 27, 2009 at 6:02 am

    yes i tryed, it wasnt good, it looked like im watching from top right.. and all characters has same angle..

  • Peter Mezes

    February 27, 2009 at 6:08 am

    thats a good idea. i will try to do it like that.. but anyway.. i’ll try to find out how to make it from one layer.. 🙂

    thanks for all your help
    Peter

  • Filip Vandueren

    February 27, 2009 at 1:23 pm
    It can’t be done in the way you have it set up.

    The X and Y coördinates of each character can only be known if you’re using a mono-spaced font, and even then, you need to first measure how many pixels they are apart, it’s not as simple as 40px Monaco is always 40 px apart. Make sure no kerning or tracking is applied.

    If these criteria (and design limitations) are met, you have the next challenge:

    What’s the Z-position of each letter ?
    Because I know of no way to find at what Z-value each letter would be after a ‘random’ wiggle textselector.
    You would need to code your own random function in an expression selector, either by using timeless seedRandoms, or the noise() function, applied to a Z-move of 2000.

    Then you have to create a new animator that rotates Y 360°, and in an expression selector do trig-functions on the angles between the camera and each letter (reusing the same random values, and a grid to know the x, y and z.) I think you can use Dan’s script for this, but the expression should be resulting in a percentage of 360° (the selector’s strength for that character).
    If the lines of ones and zeroes have variable lengths, you first need to do some string-searching to find out how many newline characters have passed, to know on what line we are. Also the code would be different depending on the alignment of the text.

    Sounds like fun no ?
    Good Luck.

    (just make separate layers for each character)

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