Tracking using 2 Axis

Does anyone have a solution to combining 2 axis being hand tracked and creating a single axis which would interpolate rotation and scale from those values?

I might be misunderstanding something here but if you have a 3rd axis feeding 1 and 2 simultaneously, does that not give you what you want.

Basically I have AXIS 1 which I’ve manually tracked on the left side of screen. I then have AXIS 2 which I’ve done the same on the right side of screen.
What I need is the relationship between the 2.
For example, when AXIS 2 moves vertically, that’s a change in rotation, if everything else stays the same. If the axis’s move away from each other, it’s a change in scale.
Not sure what you mean by a 3rd axis feeding the other 2.
Exactly the same thing that is done in the tracker, but manually tracked. Perhaps one can manually track in the tracker? Not sure.

I have copied the x,y positions from multiple axes into the shift position of trackers and extracted scale and z rotation that way. You could probably get z rotation using lookat.

3 Likes

it’s basically (A+B)/2 yeah?

edit nevermind. do what @ytf says.

Actually, it’s this. It assumes frame 1 is the default 100% scale. The cut and paste thing might be easier.
((sqrt(pow(axis1.position.x-axis2.position.x,2)+pow(axis1.position.y-axis2.position.y,2))-eval(sqrt(pow(axis1.position.x-axis2.position.x,2)+pow(axis1.position.y-axis2.position.y,2)),1))/(eval(sqrt(pow(axis1.position.x-axis2.position.x,2)+pow(axis1.position.y-axis2.position.y,2)),1))*100)+100

4 Likes

Seems like it makes a lot of sense. Not working for me however. Also tried the formula and got nothing. ARGH.
I wish I could just hand track inside the tracker.

I basically did this after first adding a step to create the shift x and y
I have copied the x,y positions from multiple axes into the shift position of trackers
Unfortunately the position and motion is different.
Not sure where it’s going wrong.

Reading this again and, please correct me if I’m wrong, so you have two manually animated axes and you want them to act like the two trackers. Am I right?

I have this setup I can share if you’re on 2026.2. But here’s the deal with some screenshots and the expressions:

axis1 is the first axis which normally carries the position data as well. So I’m keeping it as the main mover. axis2 is the second tracker which is used for calculating rotation and scale values.

axis3 is just a 1000 x 24 pixel rod with its pivot at x = -500 and position.x = 500 so it is a bar with its left corner as the pivot.

axis3.rotation.z = -90 - degrees (atan2 ( axis1.position.x - axis2.position.x, axis1.position.y - axis2.position.y))

axi3.scale.x = ( axis2.position - axis1.position ) / 10

The scale is not exact but will give you a starting point. This is actually Vico Sharabani’s setup from 1997 or so…

Sorry, the expression, though I believe to be mathematically correct, was meant as a joke at @andy_dill’s expense. It’s WAY too cumbersome to use as an expression in production. As for the other method, I have done it many times, but as with all of these things, I need to re-educate myself each time I do it. It’s slightly more complicated than I let on. A step by step is as follows:

  1. Manually track the two axes, one for position and the second for scale and rotation (which you have already done.)
  2. Create the axis that you would like to combine the data on and enter the tracker with scale and rotation selected.
  3. adjust the reference for tracker 2 to match tracker 1. In a 1920x1080 raster, both references should be set to 960x540. I don’t know why; this is 30 year old code.
  4. One track at a time, copy the x and y position channels from the manual axes to the shift position of the appropriate trackers. This is irritating because you need to keep bouncing in and out of the tracker.
  5. Negate the shift channels. To do this, hit the negate button, but then you need to slip the whole channel in Y because the negate button doesn’t really negate. It just changes all the keyframes after 1 to the relative negative, not absolute, so after hitting the negate button, enter the value of the channel at keyframe 1 in the Y adjust box (thanks @fredwarren , love this feature) and arrow up or down twice to slip the channel to its true negative. Once this is all done, exit trackers.
  6. add an axis below the tracked axis to adjust the initial size and position of your tracked element.

This has been tested and vetted. Sorry I didn’t think it out better yesterday

2 Likes

No worries. Will check it out tomorrow. Thanks for the detailed write up.

The quick and non-mathematic way could be, use those axis in other action, and comp two white patterns (squares, crosses) on black, and use the result to track them again in the track module. Maybe not 100% accurate, but it might be enough and work

2 Likes

easy fix. I also did a smoothening of the keyframes to even it out. Thanks.
Luckily perfect accuracy isn’t needed.