Groups > Multimedia > Adobe After Effects expressions > Re: Linking lines between 3D planes




Linking lines between 3D planes

Linking lines between 3D planes
Wed, 6 Feb 2008 16:14:12 -0800
I'd did this quickie animation in 2D, but I'd like to try it in 3D. I used Beam
to connect the start and end point to the position property of the planes.
Pretty easy, ya?

 <http://i175.photobucket.com/albums/w134/navstar/2d-links-1.gif>

Post Reply
Re: Linking lines between 3D planes
Wed, 6 Feb 2008 16:53:16 -0800
Let's say you've got two 3D nulls called "Start Null" and "End
Null".

1. Create an adjustment layer with the Beam effect.

2. Add this expression to Starting Point:
a = thisComp.layer("Start Null");
a.toComp(a.anchorPoint)

3. Add this expression to Ending Point:
a = thisComp.layer("End Null");
a.toComp(a.anchorPoint)

4. Set the Length property to 100%.

The toComp() method converts a point on a layer into a 2D comp co-ordinate. The
point needs to be in the layer's space co-ordinates, which is why anchorPoint is
commonly used. (A Point Control effect works well too if you want something
other than the anchorPoint). This technique also works well for tracking a 3D
sun for a lens flare effects.

But if you wanted to use a long thin solid in 3D space:

1. Make a 3D solid layer, 5 x 100 pixels.

2. Apply this expression to Position:
thisComp.layer("Start Null").position;

3. Add this expression to Scale:
scaleFactor = 1;
x = length(thisComp.layer("Start Null").position,
thisComp.layer("End Null").position) * scaleFactor;
[x,value[1],value[2]];

4. Add this expression to Orientation:
lookAt(thisComp.layer("Start Null").position, thisComp.layer("End
Null").position);

5. And set Y Rotation to -90.

6. Set the X Anchor Point value to 0.

Post Reply
Re: Linking lines between 3D planes
Wed, 6 Feb 2008 17:41:14 -0800
You might want to take a look at this mini tutorial. Same concept but with a
kite and a string.

Post Reply
Re: Linking lines between 3D planes
Thu, 7 Feb 2008 15:47:59 -0800
Thanks to both of you.

Couple follow ups:

Rick, that Kite tutorial is cool! But it seems to be 2D based. How would it work
for 3D layers?

Paul, the first toComp() expression is pretty nifty! However, I ran into
problems with your 3D solid method.

Am I missing something? Here's a screenshot:
Post Reply
Re: Linking lines between 3D planes
Thu, 7 Feb 2008 16:06:48 -0800
Sorry, that should have been a 100 x 5 pixel solid. Does that do it?

Post Reply
<< Previous 1 2 3 Next >>
( Page 1 of 3 )
about | contact