Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesTrainingCreative Cloud DebateFAQ

Re: Joining 2 nulls with a line in 3d space

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Darby EdelenRe: Joining 2 nulls with a line in 3d space
by on Aug 12, 2008 at 5:31:17 pm

[Mark Warner] "Thank you. Really nice solution for 2d! How do I get that z depth in there?"

You can adjust the size of the line based on how near/far it is from the camera.

Here's an updated expression for the start point, end point, start size and end size:

Start:

l = thisComp.layer("StartNull");
fromComp(l.toComp(l.anchorPoint));


End:

l = thisComp.layer("EndNull");
fromComp(l.toComp(l.anchorPoint));


Start Size:

s = value;
l = thisComp.layer("StartNull");
c = thisComp.activeCamera;
p = l.toWorld(l.anchorPoint);
f = c.cameraOption.zoom;
dist = p - c.toWorld([0,0,0]);
vec = c.toWorldVec([0,0,1]);
dist = dot(dist, vec);

s * f / dist;


End Size:

s = value;
l = thisComp.layer("EndNull");
c = thisComp.activeCamera;
p = l.toWorld(l.anchorPoint);
f = c.cameraOption.zoom;
dist = p - c.toWorld([0,0,0]);
vec = c.toWorldVec([0,0,1]);
dist = dot(dist, vec);

s * f / dist;


This should give you dynamic resizing of the beam based on its "3D" position. Note, though, that the position expression only works until you pass the camera beyond the Nulls... you'll definitely notice it when this happens. It might require that you rethink your animation if you had been planning to do a truck in past the nulls.

Darby Edelen

NVIDIA
Santa Clara, CA


Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]