Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Extrapolated null position based on two tracked points

Enthusiast ,
Mar 13, 2009 Mar 13, 2009
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.

Photobucket
TOPICS
Expressions
3.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2009 Mar 16, 2009
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 16, 2009 Mar 16, 2009
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 16, 2009 Mar 16, 2009
You guys are awesome! $$$ (or ) for the tip jar! :)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 17, 2009 Mar 17, 2009
Now how would I keep null rotation matched based on the vector formed by the two trackers?

Such as...
Photobucket
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 17, 2009 Mar 17, 2009
You simply use the angle my formula spits out --> radiansToDegrees(Ang). You may just need to add 180 degrees to reverse it...

Mylenium
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 24, 2009 Mar 24, 2009
LATEST
Thanks -- I'll try it!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines