Thread View: adobe.after.effects.expressions
7 messages
7 total messages
Started by Navarro_Parker
Fri, 13 Mar 2009 17:49
Extrapolated null position based on two tracked points
Author: Navarro_Parker
Date: Fri, 13 Mar 2009 17:49
Date: Fri, 13 Mar 2009 17:49
3 lines
944 bytes
944 bytes
The photo is pretty self-explanatory. If I have two tracked points, how can I determine the coordinates for a third position? I plan on wiring the distance of the extrapolated null to a slider to control the distance from the tracked points. <http://s175.photobucket.com/albums/w134/navstar/?action=view¤t=extrap-null.jpg>
Re: Extrapolated null position based on two tracked points
Author: Mylenium
Date: Mon, 16 Mar 2009 13:01
Date: Mon, 16 Mar 2009 13:01
18 lines
1014 bytes
1014 bytes
Determine the angle based on teh difference, then use it to drive sinus and cosinus:
Radius=thisLayer.effect("Slider")("Slider");
A=thislayer.Tracker("A").featureCenter;
B=thislayer.Tracker("B").featureCenter;
DiffX=B[0]-A[0];
DiffX=B[1]-A[1];
Ang=Math.atan2(DiffY,DiffX);
X=Math.cos(Ang)*Radius;
Y=Math.sin(Ang)*Radius;
[X,Y]
Mylenium
Re: Extrapolated null position based on two tracked points
Author: Dan_Ebberts
Date: Mon, 16 Mar 2009 13:38
Date: Mon, 16 Mar 2009 13:38
8 lines
962 bytes
962 bytes
You can simplify the math a little if you keep everything as vectors:
slider = effect("Slider Control")("Slider");
T1 = thisComp.layer("your_track_layer").motionTracker("Tracker 1")("Track Point 1").attachPoint;
T2 = thisComp.layer("your_track_layer").motionTracker("Tracker 1")("Track Point 2").attachPoint;
T1 + normalize(T1-T2)*slider
Dan
Re: Extrapolated null position based on two tracked points
Author: Navarro_Parker
Date: Mon, 16 Mar 2009 19:37
Date: Mon, 16 Mar 2009 19:37
1 lines
668 bytes
668 bytes
You guys are awesome! $$$ (or ���) for the tip jar! :)
Re: Extrapolated null position based on two tracked points
Author: Navarro_Parker
Date: Tue, 17 Mar 2009 18:56
Date: Tue, 17 Mar 2009 18:56
1 lines
722 bytes
722 bytes
That works great. Now how would I keep null rotation matched based on the vector formed by the two trackers?
Re: Extrapolated null position based on two tracked points
Author: Mylenium
Date: Wed, 18 Mar 2009 07:20
Date: Wed, 18 Mar 2009 07:20
3 lines
763 bytes
763 bytes
You simply use the angle my formula spits out --> radiansToDegrees(Ang). You may just need to add 180 degrees to reverse it... Mylenium
Re: Extrapolated null position based on two tracked points
Author: Navarro_Parker
Date: Tue, 24 Mar 2009 19:45
Date: Tue, 24 Mar 2009 19:45
1 lines
636 bytes
636 bytes
Thanks -- I'll try it!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads