Wednesday, April 8, 2009

Snake Script

Also inspired by the tentacles script, I decided to write a "snake" script. I created a bunch of spheres and animated it over a chosen geometry.

For those who are interested in writing one yourself, the formula:

arrS[i].pos =[ (arrS[i].radius/2 + stepc) , ((sin (i+stepC)) * sNsway),0]

arrS = array of spheres
stepC = circumference of sphere
sNsway = how much your snake moves left to right

If you want to know how to make the script detect the ground, and set your snake's height, there is a sample in Max Script Help. Search "Move Objects to a Surface."


No comments:

Post a Comment