Car Rig Wheel Woes (say it three times fast)

Hi All,

I have a car rig using eRacoon’s Blendswap mesh. The rig is essentially the Blender Cookie simple car rig. The location of the bone is routed to the rotation of the wheels. This works fine in a straight line but when I put the car on a spiral path the wheel bone constraint logic no longer works.

Are there any rig masters out there that have a solution to this woeful problem?:confused:

To observe what I am talking about open up the attached BLEND file and press play. Sometimes the wheels spin forwards and sometimes they spin backwards. It depends upon where the Base bone is located at any given time.

Attachments


27_rig_car_1b.blend (156 KB)

The reason it doesn’t work is that method is based on a linear distance. When you follow a curve, its no longer the case.

There is one way where if you’re having a vehicle follow a path, you can divide the length of the path by the circumference of the wheels to calculate wheel rotations over the path distance. I animated wheels on a train using a driver I made based on this. However the plugin needed to calculate path length is one that doesn’t come with Blender. (Why? I have no idea. Honestly though, length really should be a built-in property associated with path objects.)

I remember downloading “get-path-length” plugin a while back, but I’d have to do some digging again to find it again.

Atom,

Was playing around with car rigging a few month’s back. I think I have a rig that will work. Nothing fancy like springs and auto body roll, but a basic rig that would fit this style/work you have going on with this city generator.

No promises, but I’ll look into the work I have. I saw the work you’ve done with this generator, and thought it would be fun to try my car rig on…

Randy

Cool,

I am experimenting with other ways to move the wheels using drivers. I can get distance or percent along path but I am not sure how to take into account wheel size or route the final data to quaternion rotation of a pose bone.

@Atom

I have made several attempts to use this “transform constraint” to do rotations… it never works for me… same problem as your having there… one rotation and it goes all arigh some how… I avoid it’s use in all instances if I can… I always seem to be able to make do with Copy Rotation or Copy Transform constraints of jump right into drivers…

however…

after having looked at your file and tried to use drivers… I still get a back and forth result…

interesting… veeeeeerrrrryyyy interesting…

I am making some progress, thanks everyone. I have ditched quaternion in favor of euler and have basic rig working based upon distance traveled along a curve (Mackraken’s code from curve tools helps again!). I discarded the constraints as well using a driver to rotate the bones instead.

well I got the back wheels to work right…

27_rig_car_1b_NorvMod_002.blend (1.08 MB)

Still working on getting the fronts to work…

Basically I wanted to access the Curve Modifier… (not the curve constraint) so I built a edge only Arrow…“Road_Tracker”… gave it a curve modifier… animated it on the Y axis to match the car… (shouldn’t be to dificult to connect it to the Car Rig somehow)

then simply use a driver on the tire bones (at least the back ones) connected to the y location of the “Road_Tracker” object…

in the driver I used a simple expression… (3*varROT) you may have to change ‘3’ to something more accurate… but ‘3’ looked about right… also using a curve instead of an expresion here might work better…

Okay here’s an updated file…

27_rig_car_1b_NorvMod_003.blend (1.08 MB)

Just added a couple of front tire bones…

Wheel_frontSpinner.L and Wheel_frontSpinner.R

parented them to the Front wheels respectively… (but places so that there base is at the same rotation points as their parents…

and just added the same drivers as the back wheels…

use these as the deformers for the front wheels… and because they are parented to the origonal front wheels they will steer with those bones…

Sorry, I’ve been absent… Took a look thru my files and I have a scripted wheel rotation solution, based on Roubaul’s 2.49 work. For some reason, it won’t work once the rig is on a curve. Works fine for key frame animation… If you want to see the file and scipt, I’ll send it to you.

Rotation based on curve length is the way to go on this. I’ll look at norvman’s file, and I have a few ideas as well…

Also see here: http://ww.youtube.com/watch?v=v_bgexISCSA

Think that covers the whole process that you want Atom.

Anyhow…

Randy

Norvman, pi is that magic number you’re looking for. If you ever took trig in highschool, well, it’s finally good for something. :wink:

Old vid… Made before I knew there was a plugin (the one I mentioned earlier), however the idea works. :slight_smile:

The first part will give an idea. The middle part is about an array I used to get the measurement. However since there’s a plugin to get the path length, you can skip the middle part for how I made the driver at about 4:16 or so into the video.

@pauljs75

pi is that magic number you’re looking for.

LOL! yep!.. I’m just lazy some days… and in the process of throwing something together I rarely stop to think in those terms… “eye balling it” and “holding my tonge just right”… LOL! … gets the job done on the first round… trying to get the over all Rigg working before I refine things out…

I was playing around with the plug in for getting the curv length the other day… revolt_randy was showing me that…

Thanks for the continued replies.

@norvman: Thanks for the BLEND file setup I am going to have to figure out it all works now.

I also recomend this little tutorial talking about Radians,

it has some interesting and useful information about pi… circumferances… Radians… Radiuses…

also

@pauljs75
I use arrays to measure stuff all the time…

I need to do a video tutorial on that here at some point…

I did a quick discription in my post… and it’s really not a complete Rigg… that is the “Road Tracker” is really not combined into the Rigg like I would like… but it was an easy way to fix what the issue was… which was getting some kind of a length measurement that did not wave between positive and negitive numbers…

contact me if you have questions… I think after you look at it though it will be pretty obvious how it works…