# Rotating wheels

 Thread Tools Search this Thread Display Modes
 09 September 2012 #1 WouterGilsing New Member portfolio Wouter Gilsing Amsterdam, Netherlands   Join Date: Apr 2008 Posts: 11 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 #2 uiron neglostyti   portfolio Viktoras Makauskas Lithuania   Join Date: Jun 2005 Posts: 624 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 #3 gmask Obfuscator   gmask Power Sitting Topanga, USA   Join Date: Oct 2002 Posts: 6,937 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 #4 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,478 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. 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.