-
3D lines
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.