Need assistance wrangling a sine wave

gummby8

New member
Joined
Sep 22, 2014
Messages
15
Hello,

I am in the midst of animating a 3d model for a game mod. The walking portion of the game is handled by a number that counts up whenever the model is in motion. This is to animate the legs of the model

Normally the legs of the game models are just single sticks, very easily animated with a simple sine wave equation.

However I am trying to take it to the next level with a model that is a full biped complete with thigh, knee, shin and foot.

In my modeling program I have created an animation for the model for when it walks so I know when and at what angle a part needs to be rotated. So now I am trying to build sine waves to represent each parts movement.

For the thighs it is just a simple wave

For the Knees and Shins and Feet it is much more complicated.

For now I am just trying to solve how I want the knees to animate. I have a wave drawn out how I want them to work, but I am having trouble creating the formula to create such a wave.

Here is what I need the wave to look like

21bkoll.png


The X axis represents time in frames. the Y axis represents the angle of the part.

At 0 frames the angle is 0.
At 15 frames the angle is 40
At 30 frames the angle is 16
At 60 frames the angles is 0

And then it repeats.

I am using an online tool here
https://www.desmos.com/calculator/z5gmuuepwm

This allows me to quickly tweak my formulas and see the outcome, but As you can see I haven't gotten it just right yet.

I was hoping to get a few tips on how to use that tool to create the sine wave I am looking for.

Any help is appreciated.

Thank you.
 
Because of the sharp discontinuity of the derivative, for example the drastic change of direction at frames 0, 60, 120, ..., you will always have the oscillations around those values if all you use are sines and cosines. Can you use other functions and 'restart computations' every, in this case, 60 frames. That is can you do a
f(x) = g(x - 60 n); \(\displaystyle 60\, n\, \le\, x\, \le\, 60\, (n+1)\)
where g(x) is some function.

More later

EDIT: BTW, that F should probably be equal to 9.5493 = 60/(2\(\displaystyle \pi\))
 
Last edited:
Top