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

Extrapolated null position based on two tracked points

Enthusiast ,
Mar 13, 2009 Mar 13, 2009

Copy link to clipboard

Copied

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

Views

3.5K

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

You guys are awesome! $$$ (or ) for the tip jar! :)

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Now how would I keep null rotation matched based on the vector formed by the two trackers?

Such as...
Photobucket

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

You simply use the angle my formula spits out --> radiansToDegrees(Ang). You may just need to add 180 degrees to reverse it...

Mylenium

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST
Thanks -- I'll try it!

Votes

Translate

Translate

Report

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