Some math and animation

Posted by Ockonal on Stack Overflow See other posts from Stack Overflow or by Ockonal
Published on 2011-01-16T16:51:27Z Indexed on 2011/01/16 16:53 UTC
Read the original article Hit count: 354

Filed under:
|

Hello, I have a grass texture:

alt text

I use it in my 2d-game. I want to animate it by code, without any predefined animations.

The grass should interact with wind. So when the wind is stronger, the grass should stoop into need side more.

First version of animation I made using sinusoid function, but such animation is a bit ugly, because the base of the grass moves left/right like all another part of picture. And with sinusoid I'm not able to regulate stoop of the image.

alt text

Any advices?

© Stack Overflow or respective owner

Related posts about math

Related posts about animation