Hi Kalle,
This is the expression i have at the moment. It also has a slider that it refers to, to offset it. this is used to calibrate it.
The expression is from the motion v2 plugin from mt.mograph…
calibrate = effect(“Rotation – Stare Calibrate”)(“ADBE Slider Control-0001”);
try {
diffx = position[0] – effect(“Rotation – Stare Target”)(“ADBE Layer Control-0001”)
.transform.position[0];
diffy = position[1] – effect(“Rotation – Stare Target”)(“ADBE Layer Control-0001”)
.transform.position[1];
if (diffx === 0) {
diffx = 1;
}
sign = 1 + (-1 * (diffx / Math.abs(diffx))) * 90;
radDegExp = 1 + radians_to_degrees(Math.atan(diffy / diffx));
value = radDegExp + sign + calibrate;
} catch (e) {
L = null;
}