Hello all!
First I want to apologize for my being slow and low at math as this question likely involves.
I made a crab that I am wanting to animate through drivers.
The crab is moved through an empty that is labeled Main_empty.
There is a basic driver to animate the movement of the legs following a curve labeled Leg_curve.
When I move Main_empty on the y axis, the driver works properly and the leg moves alonside the Leg_curve.
Although, I had liked to push the animation further, so that when Main_empty is moved along the x axis or on both x and y axis, Leg_curve would rotate on the z axis accordingly.
To explicit the idea, it would look like this if movements are only along one axis or the other:
if Main_empty moves on y = Leg_curve on z (0°)
if Main_empty moves on x = Leg_curve on z(-90°)
if Main_empty moves on -x = Leg_curve on z(90°)
if Main_empty moves on -y = Leg_curve on z(0°)
Although, how to calculate Leg_curve z angle when Main_empty moves on both x and y?
I gathered that the equation would be the following:
tanθ = y/x
But if I comprehend it well, this equation is only valid with fixed positions.
And here we are dealing with vectors(if I am correct).
Then the questions would be:
- how can I turn x and y location for Main_empty into vectors
- how can I calculate Leg_curve angle from the obtain vectors
- additionaly, is it possible to implement the equation directly as a driver or would it need other wizardry?
I gather this âsimpleâ idea might prove more complex than I imagine, as in requiring some notion in Python (which I can only vaguely read) and math.
But any hint welcomed!
As an addendum, I am using drivers to animate the leg of the crab.
I am having an issue as onyl the lowest (latest?) input variable is taken in account.
Here that would be the x location. So the driver only works when the Main_empty is moved on the x.
Although, I can see that there is a âvalueâ being calculated for y too but it isnât reflected visually.
Is there a way to apply the expression for both x and y location at the same time?