Maya Local Direction

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
Maya Local Direction

What I'm trying to achieve is basically local translation in Maya attached to wheels for example: Moving a car forward in it's LOCAL Z direction and the wheel would spin the same speed no matter what rotation is applied, I've got close, this is what I've done!

1. Connected the parentInverseMatrix and the worldInverseMatrix of the driver into a multMatrix node.
2. Connected the output of the multMatrix node into a decompose matrix node.
3. Connected the outputTranslateZ from the decompose Matrix node into the driven objects rotationY. This does work! Only problem is for some reason when I rotate the driver it rotates the driven, that doesn't make much sense to me though, do you know whats happening here or how I may fix it?

Matrix: https://www.dropbox.com/s/udkevskv41ruz01/matrixTest.mb
Expression: https://www.dropbox.com/s/q7xikbw4csx8uz4/wheel.ma

Thankyou!
Shannon
 
Old 01 January 2013   #2
maya does not have a single attribute on a transform node to describe direction. so there is no world space direction, parent direction or local direction. that is because DIRECTION is derived from "positon in time", or, in other words, "position(now) - position(before)". Without any dirty hack you won't properly setup that in a stateless graph.

I can't count how many times people tried to connect position attributes to rotation and get a wheel magically work. It sounds so trivial yet it is not. The only way to reliably make wheel spin properly to translation is to actually *SIMULATE* it.

As I mentioned, there are dirty hacks. You can store a last computed position and rotation used for calculation, and use it to create derived new rotation from new position - but it would not be stateless solution, thus making it utterly rubbish if you, for example, start jumping back and forth on a timeline or render the sequence on multiple machines.
__________________
Victor
ngskintools.com - skinning plugin for Autodesk Maya
 
Old 01 January 2013   #3
yes , uiron is 100% correct ,
The best way Is to simulate after the animator is done , you can get close to a real accurate spinning but will have always some down side.

for example I used a custom cache value node I made to cache the position and get the direction and so on works nice but of course if you jump back and forth in the time line your result is not accurate anymore . (since it s a some kind of simulation aswell )
__________________
My website/blog , with a lot of tips&tricks about maya API,python,and pyqt , and tutorials
www.marcogiordanotd.com
llinkedin
 
Old 01 January 2013   #4
You can also use a motion trail / curve path to do this kind of stuff and blend in/out when your wheel is not touching the ground or you needs to animate manually.( you can do fun stuff like projecting the curve on the ground to retrieve the actual length and spin of the each wheel: who needs trigonometry when you can simply use curve length?)
 
Old 01 January 2013   #5
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



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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:15 PM.


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