CGTalk > Software > Autodesk Maya > Maya Character Setup
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 09-17-2012, 01:45 PM   #1
New Member
Wouter Gilsing
Amsterdam, Netherlands
Join Date: Apr 2008
Posts: 11
Send a message via MSN to WouterGilsing
Rotating wheels


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?
Old 09-18-2012, 12:43 PM   #2
uiron's Avatar
Viktoras Makauskas
Join Date: Jun 2005
Posts: 609
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 - skinning plugin for Autodesk Maya
Old 10-02-2012, 03:15 PM   #3
gmask's Avatar
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
Old 10-02-2012, 03:15 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
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.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:18 AM.

Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.