# How to animate feet (scripting) and have ground move same speed (no slipping)?

 02 February 2017 #1 HarvestrX Explorer portfolio   Join Date: Mar 2014 Posts: 4 How to animate feet (scripting) and have ground move same speed (no slipping)? Hello all! I am working on a project where I have to script the animation of a quadruped walk and run cycle. The walk cycle isn't hard, with a sin function for up and down motion and cos or -cos for the forward and back motion. Yet I don't get how to make the ground move with the feet at the exact speed they are moving. After all, if I assign a sin or cos function to the ground it will move back and forth, as it goes from 1 to -1 and back in a cycle. Here is my code so far: Quote: \$amp = 2; //controls height of foot during animation \$ampz = 3; //controls forward and back motion of foot during animation if(frame < 100) //speed up for 100 frames then stop, as a test to see the code is working \$speed = 3+time*2; else \$speed = 0; //this is to just test if they object will stop at frame 100, will later add in whatever the heck slows it down. \$footmove = \$ampz*cos(\$speed*time); //front foot \$footmove2 = \$ampz*cos(\$speed*time+3.14); //back foot \$footup = \$amp*sin(\$speed*time); //front foot y motion \$footup2 = \$amp*-sin(\$speed*time); //back foot z motion foot.translateX = \$footmove; if(\$footup >= 0) foot.translateY = \$footup; else foot.translateY = 0; foot2.translateX = \$footmove2; if(\$footup2 >= 0) foot2.translateY = \$footup2; else foot2.translateY = 0; ground.rotateZ = -1*(\$amp*\$speed*time*.43); /*ground object rotation (huge cylinder on side, so it can rotate and close up it looks flat*/ share quote
 03 March 2017 #2 divitorobert Explorer portfolio   Join Date: Feb 2017 Posts: 20 this code for which game can you post more info than i can solved your problem share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     CG Awards     Featured 2D     Featured 3D     Latest Entries Main     News     General Discussion     Featured Videos     Education     Off Topic Challenges     CGSociety/IAMAG Beyond the Wall     Stylized Environment Challenge     Lighting Challenges     Professional Feedback Software     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax Tutorials & Tips         3dsMax Resources         3dsMax SDK and MaxScript         Plugins & Add-ons         Particle Flow     Maxon Cinema 4D         Cinema 4D Resources     The Foundry Modo         The Foundry Time Travel Challenge     Pixologic ZBrush     Photoshop / Painter     Side Effects Houdini     Blender     Lightwave 3D         LW Resources         LW Tutorials     Allegorithmic Substance         Substance Designer         Substance Painter     E-on Software Vue     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion WIP     WIP/Critique: 3D     WIP/Critique: 2D         Speedpaints & Sketchbooks     WIP/Critique: Animation     Collaborative Projects Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling         Modeling Challenge             Member Model Collection     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     VR/AR     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 03:27 AM.