View Full Version : Wheel Rigging problem
KaiserBreathX 09-09-2010, 11:10 AM Hi. I am currently trying to rig a bike in 3ds Max. Currently, what I did was to make the 'MasterControl.Translate.Y' to control 'Wheel.Rot.Z'. All is well if it is moving in a straight direction. However, once I tried to rotate the MasterCtrl to 90deg, the wheel will turn no more. Moving in the opposite direction will causes the wheels to turn in opposite way too.
Using expose.transform on the Master, I noticed that the translate changes each time between X and Y when it is rotated, which is why the wheels does not rotate as the translate switches between X and Y.
However, I noticed this is an information in expose.transform which i can use, which is called 'Distance To Reference'. Whenever the wheel is spinning forward, the value will increase, but when is spins backwards, the value will decrease.
This is a part of formula I am trying to come out with:
if Dist-(at time (currentTime-1) Dist) > 0 --Dist='Distance To Reference'
then
Dist-(at time (currentTime-1) Dist)
else
-(Dist-(at time (currentTime-1) Dist))
This way, I can know the positive value increment for every frame of the translation. What I was intending to do is like having this increment value stacking on top of each other with time, meaning if the bike is moving at a constant value of 2, at 100 frame it will be a value of 200. However, I do not know the way to do this.
Thanks for helping in advance and please tell me if you al got better method of approach. Thanks!!
|
|
You will probably want to add a custom attribute on top of the controller where you can store the old value, that you can use to compare to the current value. Then you can figure out the direction. Also if you are going to use network render, you should figure out a way to bake the animation to keyframes, otherwise it will break!
-Johan
KaiserBreathX
09-09-2010, 12:28 PM
thanks for the reply. Do the know the script to store the old values for the cust.attribute? Also, what is the problem with network render? Thanks.
I have to lookup a file where I have done this and what I stored exactly, I think it was distance traveled, this guaranteed that the animation was consistent on playback. From distance you calculate the amount of revs the wheel makes.
Why you need to bake it is that if a scene is assigned to a slave for a range of 20-30 it will calculate a different start rotation, so you'll get jumpy renders. Baking it out to a new layer (list controller) and disabling the script layer ensures animation won't break in the network render.
-Johan
KaiserBreathX
09-09-2010, 01:27 PM
Hi, thanks for the reply again. The problem is I do not know how and which distance to target. The distance I found are usually the displacement from the starting point and not the actual distance travelled.
Is it possible to take a look at my simple wheel test?
http://www.yousendit.com/download/UFVxb2VDd0lFc0t4dnc9PQ
I had keyed some animation and there is a expose transform to see the values.
Thanks alot!!
Maybe tomorrow :hmm: I'm working on location and do not have max nearby...
The distance you save is the accumalation of the distance travelled each frame.
So distance between time and time -1 is the distance travelled for that frame, you add that to the distance previously accumulated and stored in the customAttribute. With the new total distance you can figure out the amount of rotation.
I'll have a look as soon as possible.
-Johan
KaiserBreathX
09-09-2010, 02:59 PM
you are right. That is exactly what I am going to do and sadly that is also what I do not know how to do.
However, now I can get the value for distance travelled by 1 frame. I am now trying to get the degree rotated by the wheel by (Distance Travelled/Radius of Wheel). I am trying to associate the distance travelled with the arc of the wheel(Circumference).
Lets hope it will work.
Thanks!!
KaiserBreathX
09-09-2010, 03:07 PM
oh well, it is spinning worse then before.
This is the script I used:
if
$ExposeTransform01.Distance-(at time (currentTime-1) $ExposeTransform01.Distance)<0
then
-(radToDeg($ExposeTransform01.Distance-(at time (currentTime-1) $ExposeTransform01.Distance)))/18.5
else
(radToDeg($ExposeTransform01.Distance-(at time (currentTime-1) $ExposeTransform01.Distance)))/18.5
*Radius of wheel=18.5
I think you need degToRad, as rotation controllers internally work with radians and not degrees. Your code now should produce incredible speeds :)
-Johan
KaiserBreathX
09-09-2010, 03:25 PM
Hi. I tried changing to degToRad, however, the values seems to be too small. This are the readings for 5 frames:
degToRad$ExposeTransform01.Distance-(at time (currentTime-1) degToRad$ExposeTransform01.Distance)
0.00652409
0.00451124
0.00291014
0.00162244
0.000522971
0.0
Using these values, I still need to divide by 18.5 to find the rotation degree, but it seems to be near 0 so the wheel pratically looks like it does not rotate at all.
Whereas if using radToDeg the values are:
14.8101
9.55322
5.32617
1.7168
0.0
However, it nows spins even weirder then before using this formula. haha.
CGTalk Moderation
09-09-2010, 03:25 PM
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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.