Sway, continued


The sway algorithm I had in mind seems like it will work well, but I'm faced with two problems:

1. How to communicate the sway values to the animator.

The sway occurs at a fairly low level, basically at the "rendering" stage. This is fairly opaque to the game engine itself, which just says "draw this". The rendering engine takes as a parameter a particle, which is supposed to be the physical representation.

I think the answer therefore might be to add a sway acceleration parameter to the particle. This makes sense because it's part of the physical simulation, even though it won't actually affect the position of the object.

2. How to introduce randomness into the animator.

Each swayable object has a few parameters that can be easily set at the start, but right now everything sways "together", since initial conditions are the same. What I think is that there is probably room for two sources of randomness.

First in the "snapback" factor which for each swayable object roughly indicates how stiff or rigid it is. This would naturally vary and for instance, with a tree, the trunk or lower level branches would have much higher snapback factor since they are more rigid.

The second place to randomize woulds be the input velocities themselves. If you walk through a bush, you maybe overall create a sway in the direction of your motion, but the shape of your body and the branches you are interacting with will be somewhat varied, so we can characterize this by just randomizing the sway variable slightly.

2009-01-12


◀ Back