-
Constraint movement along X, Y and Z axis
Hello reader,
I am struggling creating an expression to constrain movement of a layer to a certain angle. I found this isometric expression which works great:
pos = transform.position;
x = effect(“X Movement”)(1);
z = effect(“Z Movement”)(1);
y = effect(“Y Movement”)(1);
[x*Math.sqrt(3) + z*Math.sqrt(3) + pos[0], -x + z + y + pos[1]];But how can I adjust this to match angles of 190 and 140?
EDIT: Found it for the X axis (thanks Dan):
x = effect(“X Movement”)(“Slider”);
a = 190;
y = -x*Math.tan(degreesToRadians(a));
value + [x,y]But how to adjust this so Z has an angle of 140?