Problem [Animation/maths] "Aiming" at an arc

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
7,926
Reaction score
1,005
Points
188
Location
Toulouse
So I'm trying to code a landing leg animation so that the 2 "front legs" and the third "back leg" rotate at the same time. To be more specific, I want the end of the third leg to be at the base of the "foot" during the whole animation. So I coded a child translation animation so that the "back leg" jack extends as the leg rotates around "pivot 2", it works. The problem is the rotation rate of that back leg. It can't be linear, else the jack won't stay at the base of the foot and it looks weird. Instead, the rotation speed of the "back leg" anim should follow a curve that matches the arc described by the "front legs" rotation (centered around "pivot 1" and of radius r).

I lack the mathematical tool to do this, so anyone has an idea ? I'm sure it can be done, all I need is a mathematical function that controls the speed of the "back leg" rotation.

Here's a small drawing, I hope it helps understanding my problem :

LandingLeg_anim.png

Many thanks for helping ! :cheers:
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
1,783
Reaction score
287
Points
83
Shouldn't it just be:
For each step, calculate the vector from pivot1 to end of vector "r"? Length and direction of that vector should fall out of that, right?
A function describing this however is something I am not too good at ;)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
36,404
Reaction score
870
Points
203
Location
Langendernbach
Well, just draw the resulting situation in 2D and look for a mathematical problem that is similar, what will you find?
LegMath1.png

As you can see, its all about Thales and Pythagoras now.

And as you can also see, the important battlefield of your problem is the length a in the middle.

You can now happily apply trigonometry to solve the problem for getting the angle alpha
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
7,926
Reaction score
1,005
Points
188
Location
Toulouse
@Urwumpe : What I don't get is that you seem to depict a particular case, where "pivot 2" is located on the blue arc of radius r. I don't think it is the case.

I assume that the small white line is for the forward legs, and the small "l3" one is for the back leg ?

I probably just don't get it, can you enlighten me just a little bit more ?

Edit : this is what I get in 2D "side view" where

s can vary in lenght (variable). r is a constant. Angles a, b, c are variables.

s and r must join in x, which is a point that moves along the arc (here, in the counterclockwise direction).

p1 and p2 are the pivot points respectively for s and r.

d = 0.340332 m
r = 0.613203 m

what I need to know is the value of angle c, and the lenght of s so that the above conditions are met when x moves along the arc.

Problem.jpg
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
36,404
Reaction score
870
Points
203
Location
Langendernbach
Just mirror the drawing over the vertical axis... Also, isn't p1 fixed and r constant? If yes, all possible positions of x will be on a circular arc of radius r....
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
7,926
Reaction score
1,005
Points
188
Location
Toulouse
OK asked around in a math-specialized forum, the guys came with that function :

c = atan[r.sin(a)/d-r.cos(a)]

Let's try.
 
Top