This kinda assumes that the head is near the origin. If you put the base of the tail at the origin and apply the sin to the head also it will probably wiggle convincingly in the opposite direction from the current tail beat.
Speed implicitly includes the a scale factor for elapsed time. There are a few more terms you’d probably want to rationalize.
P.S. you may need to use -elapsed_time, depending on the axis this has been modeled along, you may also need to switch x & y or even use z for the same obvious reasons.
[This message has been edited by dorbie (edited 02-23-2004).]
Originally posted by Elixer:
[b]Dorbie, why was this topic not locked or moved? I don’t seen anything even remotely related to openGL in the post.
Or did you hand in your moderator duties?
[/b]
but at least it can still be considered more or less advanced coding related to graphics with the slim chance of opengls evaluators being of any help. so its by for not as off-topic as some other recent posts… including yours and mine ,-)
and i guess the above methods should look a lot more convincing than erratic and random tail-slashing (which could then easily be dont with a few bones and applying halfway random rotations. considing that snakes and the like usually seem to make pretty regular and clean movements.