-
Remapping Angles to Control Position
Hey All,
I’m trying to remap an angle slider to control position. The idea being as the angle rotates, the position of an object is displaced outward along that line.
I’m sure there’s an easier way to do this than the below (which is not working for semantic reasons I think). Help?
Current exp for Y-axis (X-axis would follow)
// Angle a=effect("Linear Wipe")("Wipe Angle"); // Displacement
x=effect("Amp")("Slider");
if (0<a<=90) {
linear(a,0,90,0,-x);
} else if (90<a<=180) {
linear(a,90,180,-x,0);
} else if (180<a<=270) {
linear(a,180,270,0,x);
} else if (270<a<=360) {
linear(a,270,360,x,0);
}Thanks tinkerers,
Sam