# Rotating wheels

 09 September 2012 WouterGilsing New Member portfolio Wouter Gilsing Amsterdam, Netherlands Rotating wheels Hi, I'm trying to create a rig or the wheels of a car. I've written an expression to make the wheel rotate when you move the car forward (in Z direction). My expression : Wheel.rotateX = 360 * group1.translateZ / (2* 3.14 * radius) This works perfectly, untill you try to make the car turn, since the wheels only rotate when you move the car along th Z axes... So when I attach it to a motion path the wheels stop rotation when the car makes the turn... Any ideas on how to solve this? share quote
 09 September 2012 uiron neglostyti   portfolio Viktoras Makauskas Vilnius, Lithuania In general, you can't calculate wheel's rotation just by it's current position. This sentence might infuriate some people, especially those with your expression above, saying "it works on one axis, help me make it work on all others". The truth is, you can only get correct results with simulation. By "simulation" I mean that when calculating current rotation, you have to know wheel's position+rotation in previous time sample and how much travel was made between previous and current time. to make matters more complicated, you'll have to decide what you want to do when wheel rotation is not perpendicular to travel axis: options include - orient wheel to travel axis automatically, rotate only this much to decrease sliding effect to a minimum, rotate wheel around axis perpendicular to travel axis (stupid but still an option). This all will involve a minimum knowledge of what a transformation matrix is. All in all, for a beginner my answer would be - just keyframe wheel rotation manually. You won't make it foolproof to adjust rotation automatically, so some sliding will happen anyway, and depending on what you want to animate, you'll want your wheels to have their own rotation (e.g., hard brakes, traction control effects etc). __________________ Victor ngskintools.com - skinning plugin for Autodesk Maya share quote
 10 October 2012 gmask Obfuscator   gmask Power Sitting Topanga, USA you'll want to find the difference the current vector of the wheel and the vector on the previous frame and then use the magnitude to calculate the rotation. __________________ blah blah blah share quote
 10 October 2012 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. 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.