PDA

View Full Version : Car wheels on a rugged surface


sekops
04-08-2007, 01:54 PM
Does anyone know how to rig a car so when it moves along the ground the wheels stick to the ground?

Or how do games do it, when u send the car along a path, the car would tilt according to the ground plane, with the wheels following the terrain.

Im just curious....

hblan
04-09-2007, 12:35 AM
this need many settings for a car .
about the wheels and the ground . set the center of the wheels a helper box , and then at the position controller , z axis , assign a script controller , do follow :
1. make a ray , direction is down ,
2. caculate the intersection of the ray and the ground , command : theReturn = intersectray <ground> <ray>
3. theReturn.pos.z is the offset of the wheels z axis .

sekops
04-09-2007, 06:50 AM
hmmm, that sounds reasonable

ok, i will try

Fabiomussarela
04-09-2007, 02:13 PM
Im trying to do something similar, Im using intersect ray too :)

Heres my test !! works nice with 2 wheels, but Im still thinking how to move correctly with 4.

http://usuarios.cmg.com.br/~hp-mussarlz/MussaCarRig2.zip (http://usuarios.cmg.com.br/%7Ehp-mussarlz/MussaCarRig2.zip)

hblan
04-09-2007, 03:21 PM
for 4 wheels , it is almost same as 2 wheels bicycle . the difference is it have 2 wheels as front_wheels and 2 for rear_wheels. so u can make a bone system with ik solver , link the wheels to the basebone and the ik target . the bone system need only 2 bones .

and for the spring of the car body , use the front bone and rear bone , u can make spring helpers ,and use them to control the car body . make it swing when car moving .

Davvey
04-14-2007, 09:51 AM
Hi
Not sure what software you are using but try the script pack for Maya at
Davvey's Vehicle Rigging Scripts (http://www.highend3d.com/maya/downloads/mel_scripts/animation/Davveys-Vehicle-Rigging-Scripts-4109.html)

This uses Utiity Node to build a full rig to control suspension, roation and vehicle tilting. Also adding to amotion Path and setting up auto Ground Control to a Ground Plane. There is ahelp file that explains script usage. I foyu want any more info let me know.

The script pack is a work in progress and I am currently working on adding a Truck trailer type rig to the pack which will alow the connecting and disconnecting of the trailer along with linked and independant motion for both parts.

PS the scripts will rig Multiwheel set ups also ie. A truck type vehicle with Multiaxles front and rear (up to ten Front and Rear)

eek
04-14-2007, 04:30 PM
4 rays hitting the ground with limits, ie suspension so the wheels can only go so far up or down. Then derive a normal from the rays for the orientation of the chassis - this could be delayed via frame, or callback handling - i.e the longer the delay the chassis gets resolved the more bouncy it is. Direction/turning can be worked out by frame checking i.e get a pos at -1 and position at current time and derive a vector direction (look at vector) for the car. This could be worked out with Verlet interpolation to determine velocity between frames and suitable turning needed by the wheels etc. Would love to have a go at this sometime.. maybe script it or something.

Aearon
04-15-2007, 12:25 PM
instead of directly working with the time, again i would store the current position in a script controller variable and use that on the next frame, this is lighting fast for wheel rotations as well, i wouldn't let max evaluate anything outside the current frame if you can avoid it!

depending on what you need in the rig and in terms of speed you should also look into the pixar papers on 'cars'

i.e. rendered height maps instead of directly using the geometry which may be insanely high detail in a production shot. this also gives you all the details of displacement maps for use in the animation rig.

with this technique you will be able to do a lot of sampling on the terrain without big costs in speed, for example you could sample 4 points like eek suggested for the chassis, also for each wheel, or maybe a whole grid of points for the wheels to drive a deformer.

in my experience this is not slower than a simple constraint, the biggest cost is memory but it should be affordable.

(edit: just noticed this was the rigging forum, not max specific, anyway parts of my post assume max usage ;) )

sekops
04-16-2007, 06:03 AM
Thanks everyone for the posts, its gives an array of possibilities. Im using maya, but it would be interesting to know what could be done for other softwares. I dont have that much time for the next 2 weeks, but will dive into something asap, and let everyone know my progress.

Currently i worked out a rig for one wheel, and a body. Its just using the utilitty nodes that has an expression on the Y distance between the wheel and the ground, when the wheel has a limit on how much it bobs up and down (ie suspension) and would pull the body down or up depending on the limit reached. Then for a car with four wheels, im thinking ill have to write a trigonometry expression that would average the 4 wheels and will decided the tilt of the axle and car body.
Im approaching it the simple way first. Just an exploration. What do u guys think?

I havent tried vector ray, and im not sure if Maya has that anyway. Seems logical. Will try everyones methods too!

Plus.... It would be cool if everyone posted up what software their using. Im using Maya

Aearon
04-16-2007, 06:38 AM
the methods i posted should be applicable to any software with sufficient scripting abilities, but i used max

for getting the angle of the body based on 4 points you can use an aim constraint.

you can use a locator in the middle and apply an aim constraint aiming 50/50 at the two front points,

use another locator in the middle of the two right or left points, this will serve as the upnode to the first locator.

very simple and works great for me, i use it for both the body and the wheels (each with 4 points attached to the ground)

Davvey
04-16-2007, 07:16 AM
Hi

To get a true position of the vehicles body relative to the ground you will need values for each corner. Use two locators at each axle corner to give true height one contsrained to floor or ground plane the other to the Bodywork. You need to average these for both front and rear tilt then convert to an angular value to tilr bodywork. This simulates vehicle tilt and roll independant of the wheels. The script pack I mentioned does this using utility nodes to calculate distance avearge and convert to an angl for tilt.

Also suspension travel can be added in on top of this so as car is raised from Ground Plane (jumping or bouncing) wheel travel is adjusted to compensate and once travel excedds range the wheel leaves the ground at different rates for each corner depending on surface contours. To accuratelt protray vehicle movement and susupension travel can be quite complicated if you want realistic reactions between Vehicle, wheel, suspension and the ground.

The rig I mentioned allows the Vehicle to be "grabbed" and move in real time and suspension reacts correctly. Also by keyframing or attaching to a motion path it will react correctly to follow Ground and vehicles actions.

Using utility nodes will give fast and accurate response times even in a fairly complex scene as all the connections are direct and unlike an expression do not have to be evaluated before action is taken.

Aearon
04-16-2007, 10:40 AM
davvey can you comment on how fast or slow constraining to a surface in maya is?

lets say you have a production shot with a rocky desert surface, is this going to work in realtime?

lets say it's 10.000 - 20.000 polygons

Davvey
04-16-2007, 10:56 AM
Hi

A shot of 30 000 plus polygons works in real time with no problems on my machine which is a dual opteron 240 with 4 MB memory and an ATI X800 card. The only issue I find with real time working is more to do with the card refresh rates. The scripts work by using utility nodes to derive distance between locators and then plugs this into the tx attributes of group nodes for each wheel.

Aearon
04-16-2007, 04:21 PM
well that's nice!

i forgot to ask how many points are you constraining to the surface?

Davvey
04-16-2007, 04:33 PM
Hi

The rig has one constraint to the surface for each wheel so a four wheel vehicle has 4 constraints to the ground plane. But the rig can do up to 10 axle sets for front and rear so then there would be a total of 2 constraints per axle times no of axles. There are other constraints used to control various parts of the Rig but only the ones above constrained to the Ground Plane.

Fabiomussarela
04-17-2007, 12:07 PM
Hi Aearon :), You said something about pixar papers on cars, where can I find it on the internet?

Thanks :)

PEN
04-17-2007, 04:00 PM
I have one that was done in Max on my site. It works in real time as well using intersectRay. Uses 5 rays to solve the ground plane and angle of the car. The wheels and car body orientate them selves based on the ground plane and the direction that the vehicle is moving so you don't need to rotate the car.

This rig will be for purchase soon with many updates that are not listed on the site at this time.

sekops
05-12-2007, 04:12 AM
Heya Davvey,

I had a closer look at your script, but correct me if im wrong, the spin of the wheels do not co-relate with the translateZ of the main controller?

You could add an expression in your script where the each rotation equals to 2* pie* radius.

Thanks, your script is helpful. Im not sure when i will jump back into the rigging of the car just yet but ive thought of a few ideas, will eventually though.

In Maya; One idea is to simply set up constraints, where the main controller is constrained to the 4 wheels and just averaged out. Using Normal and point. This is the first step of course

sekops
05-12-2007, 04:53 AM
Heya Davvey,

I had a closer look at your script, but correct me if im wrong, the spin of the wheels do not co-relate with the translateZ of the main controller?

You could add an expression in your script where the each rotation equals to 2* pie* radius.

Thanks, your script is helpful. Im not sure when i will jump back into the rigging of the car just yet but ive thought of a few ideas, will eventually though.

In Maya; One idea is to simply set up constraints, where the main controller is constrained to the 4 wheels and just averaged out. Using Normal and point. This is the first step of course

shibumenon
05-12-2007, 09:07 AM
Here is a car rig with surface detection which I did a couple of years back :
I used Max .

http://www.aaachooo.com/page4_RnDClips.htm

CGTalk Moderation
05-12-2007, 09:07 AM
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.