Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Paul Maguire on June 20, 2008 at 11:17 am

    Hi.

    What’s the best method for joining 3D layers with ‘lines’? I have a system I use at the moment which does this:

    I have a long thin comp called StringComp which is the actual string (this can be animated to grow etc.). I set the anchorPoint to the left edge of it. I add the following expressions to the string layer (note I often use anchorPoints and have to do layer space transformations but this is it in it’s simplest form):

    On Position I add the following expression:
    sL = thisComp.layer(“startLayer”)
    sL.position;

    On Scale I add the following expression:
    sL = thisComp.layer(“startLayer”);
    tSourcePos = sL.position;
    dL = thisComp.layer(“endLayer”);
    tDestPos = tEndPos.position;
    [(length(tSourcePos, tDestPos)/source.width)*100, 100, 100];

    On Orientation I add the following expression:
    sL = thisComp.layer(“startLayer”);
    tSourcePos = sL.position;
    dL = thisComp.layer(“endLayer”);
    tDestPos = tEndPos.position;
    lookAt( tDestPos, tSourcePos);

    And that’s it – it actually works. However it has a problem or two. Firstly, the string is not ‘solid’ as such as it’s just a 2D layer in 3D space (this is not a problem really). But, more importantly, the larger the world space the more error – so the further away the object I try to attach to, the less it joins up with it. This is all down to the scale expression and its lack of precision. My workaround is to adjust the *100 to fit, but this is a hack. I was about to try to write a scalar function to compensate but I’m a bit uneasy about this.

    I know it’s possible to use the 2D beam instead of a comp in 3D, but the beam is only 2D and not what I want. So before I do this, I thought I’d check – is there a better way to do 3D ‘string’? I wish there was a way of saying: I want this comp to stretch from this point to this point…

    Any tips appreciated.

    Regards, Paul.

    Trent Armstrong replied 17 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Trent Armstrong

    June 20, 2008 at 3:52 pm

    This is a really fun implementation of the expression that converts 3D coordinates into 2D coordinates.

    There is one issue with using a Beam Effect. The layer must be 2D and therefore can easily pass in front of 3D layers and break the illusion. If you can figure out the relationship between those layers, you should be fine.

    You would place your layers in 3D space with a 2D solid layer over them. Put a Beam Effect on the Solid and use this expression for the Starting Point:

    target = thisComp.layer(“YOUR FIRST LAYER”);
    fromComp(target.toComp(target.anchorPoint));

    Ending Point:

    target = thisComp.layer(“YOUR SECOND LAYER”);
    fromComp(target.toComp(target.anchorPoint));

    This works especially well with layers to which you are able to match the beam color.

    See the Network Section of the promo video here: https://www.mindbenderacademy.com

    Trent

    Trent Armstrong – Creative Cow Leader
    https://www.dallasaeug.com

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