Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions question for Mylenium about “Animating Maps with Expressions” tut

  • question for Mylenium about “Animating Maps with Expressions” tut

    Posted by Gobomus on December 5, 2006 at 5:53 am

    Very nice tutorial!
    I wanted to modify it to be in 3d though…
    Instead of having the lines draw on to reach the target point, i want the target point to animate as well. So the line will start at the source point, but the target point also travels, and with it the line…does this make sense???
    Its like its scanning an area and when it hits a spot it lights up.

    When i convert all layers to 3d everything works except the rotation…

    i tried modifying this:

    delta=position-thisComp.layer(index+1).position;
    angle=Math.atan2(delta[1], delta[0]);
    angle=radiansToDegrees(angle)+180;

    [angle]

    to apply to x & y rotation and i also tried modifying it for orientation but i cant get the line to lock to the target…i somehow mess up the math…

    Do you know how to get the rotation to lock to the line in 3d rotation??

    Many thanks!

    gobomus

    Gobomus replied 19 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mylenium

    December 5, 2006 at 7:24 am

    Well, you need of course take care of the Z rotation as well. The simplest way of handling things in 3D space is to use

    lookAt(source, target)

    Apply it to the orientation, so you have the rotation free to adjust and make your lines face toward the camera (auto-orient will not look good and screw your setup). I’m not sure what you mean by the line following the target. For the math it doesn’t matter whether the target is stationary or moves. If you want the line to shrink towards the target point, just place the anchor point at the end and tweak the formulas a little. If you need just a line segment kinda “firing” toward the target like a tracer round, create that segment in a pre-comp. make the comp line shaped and have the segment sit somewhere in it. Use effects such as Motion Tile or Offset on your pre-comp to make things move.

    Mylenium

    [Pour Myl

  • Gobomus

    December 7, 2006 at 4:35 pm

    thanks!
    That works great…
    Funny..I never used lookAt before, but the perfect solution here.

    gobomus

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