PDA

View Full Version : Train Animation



manofsteel
11-09-2006, 08:27 PM
I've made a train animation in Maya. The problem is this; The train is 5 cars long. I want to set the first car to the motion path, and have the other 4 cars follow behind the lead car like a normal train or subway train. What I had to do was make 5 identical paths, set each car to their own motion path with offsetting the time. It looks great, works just fine, but it took too long and I like doing things the right way. There has to be a easier way to do this. I thought with some kind of constraints, but i've tried them all. It has to be something simple and stupid that I am doing wrong. Any help would be greatly appreciated.

TheFourRiders
11-09-2006, 10:27 PM
Have you tried using Active Passive Rigid Bodies?

-Select the other 4 cars,
-go to Passive Rigid Bodies Option Box,
-click Active (and Apply),
-apply a Gravity field;
+Then go to the first car,
+and apply a regular Passive Rigid Body,
+make your animation with the first,
=and that might work.

Make sure the cars are not intersecting, but that they are connected. Again, that might work, but then again, I have not used train models for animation yet. If it does work, then please post so.

TwinsenDude
11-10-2006, 04:53 AM
Use a Flow Path Object. DT has a handy tutorial about it here:

http://www.digitaltutors.com/digital_tutors/video_details.php?v=15

laxman
11-10-2006, 12:53 PM
The problem with a flowpath is that it will deform the object itself. You could try doing something like create 5 cubes and scale then so that they are they make a box around each car. Split then down the middle and through the width so that you have a vertex on the middle of two opposite faces. Then make it a soft body and apply a spring constraint between the middle vertex of first cube and the one on the second. Connect all the cubes in this manner, then when you move the first, the others will follow it. Play arounb with the stiffness and make a playblast of the animation to see if it is right. Then parent each car to the right cube. There is a video on using spring here, its use for a curtain I think, but it sould give you an idea of how to create the springs.

TwinsenDude
11-10-2006, 05:50 PM
why a spring constraint? Wouldn't a pin constraint work better?

laxman
11-10-2006, 11:43 PM
Opps, I don't know why I was thinking softbodies. Do what TheFourRiders said with the rigid bodies, not sure if you are going to need the gravity though. What you want to do is create a curve, then attach a cube to the curve. The cube will act like the engine of the train. Then create 5 cubes and scale them so they are rectangular and look like the cars. Space them out properly too. Then do what it says above with the rigid bodies. If you want the cars to stay perfectly rigid and move exactly like the other cars use a pin constraint, however if you use a spring constraint, you will be able to make them move back and forth slightly when the first stops, and when the first starts the last one will not move immediatly, it will wait until the one infront of it pulls it. To set up the springs you want a stiffness of about 15 and dampning of about 1. Then select all the cards and make the damping something like 3, the less you put the more they move back and forth.

In order to make sure the cars only rotate from side to side create hinge constraints between each car. You may have to rotate the constraint by 90 degrees so that it is pointing upwards.

Finally, make sure you calculate the minimum turning radius of the train so that you never get som of the cars falling off the tracks.