Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 3D Space – line between 2 points expressions

  • 3D Space – line between 2 points expressions

    Posted by Jamie Nimmo on August 27, 2005 at 6:22 am

    Hi,
    I am trying to find a solution to a problem and have found a great start at creative cow with “The World is Ours” tutorial. I am trying to create something similar to the visual thesaurus look using after effects (https://www.visualthesaurus.com), where I have a circle and then other circles pop out and are linked by lines.
    I can hand animate the circles no problem but I really want to save time by having the lines between them linked by expressions. fisrt just by a solid line, but it would be great to eventually try a dotted line? Maybe, but if its too much I can stick with solid line first as I have a deadline looming.

    I have found a start with the tutorial mentioned above but I need to go one step further by having the line follow the circles in 3D space, so that when they fly out from the parent circle, I can put in a 3d camera to follow the next spawed circles from the child.

    The method in the tutorial uses a line made from a solid, linking the scale so it grows when the target moves away from it so its always connected. As I want the source and target to always be attached, but when I move the target in Z, the line just grows passed the target, instead of moving in Z as well.

    If anyone could help me it would be great.

    -Jamie

    Filip Vandueren replied 20 years, 4 months ago 3 Members · 10 Replies
  • 10 Replies
  • Mylenium

    August 27, 2005 at 6:21 pm

    Mmh, I don’t really understand what your problem is (that growing beyond past Z is absolutely unclear)… The technique would work just as well in 3D given that you switch around a few variables and add the third dimension. If you need dashed or dotted lines, replace the solids with text layers and animate the start and end on a opacity selector. The problem is, however, that you need to adjust your text layers manually since there is no way to calculate the overall length in pixels from the typographic units – that info is nowhere accessible in AE.

    Mylenium

    [Pour Myl

  • Filip Vandueren

    August 27, 2005 at 9:07 pm

    I sometimes use the Beam-effect on a non-3D solid:

    Add a Beam effect
    set the length to 100%
    Give it this expression on Starting & Ending Point:

    l=thisComp.layer("start or endlayer");
    p=l.toComp(l.anchorPoint);

    -> change the layer name in the first line to different layers for start and end-point

    Adjust the colors, softness and thickness to taste.

    If you want the thickness of the line to follow the correct 3D distortion add this expression to Starting and Ending Thickness:

    l=thisComp.layer("start or endlayer");
    w=length(l.toComp([0,0,0]), l.toComp([0,value,0]));

    -> change the layer name in the first line to different layers for start and end-point

    Put the layer with the lines in the back of the comp and it should look perfectly 3D, eventhough the lines are not.
    If you need mulitple lines, you can duplicate the solid, or duplicate the Beam-effect, but select the option “composite on original” on all but the first beam.

  • Jamie Nimmo

    August 28, 2005 at 8:24 am

    Thankyou very much.

    The beam Idea worked like a treat, I am going to play with multiplying the thickness values to get a thicker line. Also I have noticed that the target/end point line flips to the opposite direction once the 3d camera goes past the same z space as the source/start point. I hope this makes sense. if not let me know and i’ll post a ae comp.

    -Jamie

  • Filip Vandueren

    August 28, 2005 at 10:04 am

    The expression for thickness uses the value you have set as a starting point, so if you first set the thickness so it looks good when everything is at Z-depth=0, then apply the expression, it will scale proportionally after that.

    I also noticed the error when one of the points is behind the camera, but didn’t know if it was an issue for your animation.
    I’ll see if I can find the workaround for that.

  • Jamie Nimmo

    August 28, 2005 at 11:27 pm

    Yeah, I have camera moves that push forward which means they have to go behind the camera, which is when I noticed they flip. If you can help with this it would be great, I am so new to expressions that i kind of know what I need, but hard to express it with code.

    Cheers, thankyou so much for your help I am learning so much about it with your help.

    -Jamie

  • Filip Vandueren

    August 29, 2005 at 6:27 am

    Well, after some experimenting, it turns out this is not a flaw in the expression, but a serious bug in After Effects…
    I’m not sure how and if one can work around it.
    see the post “Headscratching 3D error: Z-position”
    at https://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=2&postid=859101&theadid=859099&pview=t

    Perhaps best then to go with the tutorial you had.
    Could you post the url for the original tutorial, then I’ll have a go at rewriting the expression for 3D

  • Jamie Nimmo

    August 29, 2005 at 7:53 am

    TTHE ORIGINAL TUTORIAL I WAS DOING WAS THE “ANIMATED MAPS OF THE WORLD”

    https://www.creativecow.net/cgi-bin/page_wrapper.cgi?forumid=2&page=/articles/mylenium/world/index.html

    BUT THEN I TRIED TO ALSO USE THE “ANIMATED GRAPH TUTORIAL ON CRTEATIVE COW AS WELL, WHICH USED A MASK TO DO THE LINES, SEEMS SMARTER, BUT AGAIN COULDN’T GET IT TO WORK IN 3D SPACE

    IF YOU COULD GET BACK TO ME CHEERS,
    SORRY BOUT THE CAPS LOCK, JUST RENDERING AT THE MOMENT.

    -JAMIE

  • Jamie Nimmo

    August 29, 2005 at 7:58 am

    or the animated lines tutorial was https://www.creativecow.net/articles/mylenium/line_chart/
    seems to be a good way to do it, if you can get it to work that would be great. then will re-build over night tonight to make this thing sweet,

    cheers, can’t wait to see how you added the 3rd value for z-space for this.

    -jamie

  • Jamie Nimmo

    January 10, 2006 at 2:19 am

    Okay,
    I am back on this project again after we won the job based on the animatic I did before.
    I was wondering if there was an “advanced beam” plugin or stroke engine that has position data
    for the start and end points????

    Or if anyone can add to the point behind the camera problem would be great.
    Just working on looks at the moment so if there is any help i’ll try and address it in my comp asap.

    Cheers

    -Jamie Nimmo

  • Filip Vandueren

    January 10, 2006 at 3:00 am

    Wow,

    blast from the past…

    I’m thinking if it can be worked around with trapcode 3d stroke, but I’m quite busy the next days…

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