Wheel spin across the floor by expressions.


#1

I already did a search on this in the forum and nobody had a good solution that worked.I think I’m almost there, it’s just my lack of knowledge of expressions is holding me back.

So object.A is moving across the floor. There is a null object with an expression to follow object.A’s transform minus 1 frame from current time. (thus the null object is always dragging a little bit behind object.A except when Object.A is still) I use another expression to measure the distance between object.A and the null object. I then take that distance and apply it to the rotation of a wheel. Now I just need to figure out a way to take the wheels current rotation value and add it to the number generated by the distance. Or better yet just take the value for the wheel rotation from the previous frame and add that value to the distance value to create the value for the wheel rotation on the current frame. I’ve tried this with my little knowledge of expressions and I think I get some kind of cycle redundancy. (I’m not worried about the wheel rotation, I can get it close enough by just multiplying the rotation value of the wheel)

If I could get this to work. The only problem would be dealing with the rotation of the wheel on a skid. But I don’t really plan on ever animating a skid, so that’s not a problem for me but it’d be be nice if there was a way to terminate wheel rotation on a skid or have some control over the wheel rotation on a skid.

But yeah. The big question is… How do I take a value from an object and add that value to another object’s current value and have that current value be reevaluated based on a value from a previous frame?

Or if there is a better way to make a wheel turn while going across a surface. I’m open to suggestions.


#2

nvm. I got it working. It just looks crazy moving it around in realtime but it animates fine. but it sort of calculates on the fly, which means that if you ever render frames 1-30 one day. Then open up the scene again. and render frames 31-60… The wheel will jump out of sync going from 30-31. I guess that could be solved by baking the animation or transferring it. and of course the skidding problem but I guess that could be taken care if with a condition expression that looks up an user controlled variable on or off switch? but besides that, looks fine.


#3

There are many ways to calculate wheel rotations. A lot of them suffer from one limitation or another.

The things you should look out for are these:
. wheel rotation going back and forth
. wheel rotation when going up and down
. breaks
. skidding
. steering (preferably automatic with manual overrides)
. ground detection

All of these problems are normally solved with scripted operators. Expressions are limited in scope.

You can view an idea here: http://www.youtube.com/watch?v=ILZR9jEekB8


#4

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.