Hi everybody,
here is what I’d call a simplistic simulation of the way of locomotion of a snake. I made use of rigid body constraints, a bit of python to set and drive the constraints and an-isotropic friction. No interactivity, you launch and watch.
To make the snake shorter or longer, you can easily edit the module SINS.py; I’ve left a comment in the code that explains.
It’s not much but I think it’s fun.
I’d be glad to know what you think.
By the way, I use UPBGE 0.2.5. SINS_Demo.blend (455.7 KB)
Hello,
another little demo. Now the snake crawls on a little planet and finds his way to random-positionned targets. SINS.zip (858.0 KB)
Enjoy!
EDIT:
My bad! I forgot the screenshots!
Plus the updated blend, now with obstacles and debug display(press D-Key) SINS_Planet_Obstacle.zip (868.0 KB)
Hope you’ll like it!
Again, my bad, the snake was bugged. I had error messages from python in the console. Something with the function Vector.negate() returning None. I replaced the statement with Vector*-1 and now the snake pass the obstacles correctly on either sides.
Here is the last version: SINS_Planet_Obstacles_DebugDisplay_.zip (866.6 KB)
Another thing,
I know I’m don’t comment my code and I know it’s bad. I’ll try to remedy that. If you want me to try explaining the way my thing works, let me know.