|01 January 2013||#1|
Join Date: Sep 2009
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?
|01 January 2013||#2|
Join Date: Jun 2005
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.
ngskintools.com - skinning plugin for Autodesk Maya
|01 January 2013||#3|
London, United Kingdom
Join Date: Aug 2008
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 )
|01 January 2013||#4|
Join Date: May 2004
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?)
|01 January 2013||#5|
Join Date: Sep 2003
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.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|