Animating Steam Locomotive Rods

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


Sie betrachten gerade eine ältere Version des Eintrags. Klicken Sie hier, um zur aktuellen Version zu gelangen.

  • How to animate the piston, the coupling rod and the connection rod of steam locomotives.
    [b][u]Preparation[/u][/b] First of all you need to create the different colored parts in this picture: [img]http://www.train-fever.net/index.php/Attachment/14704-TrainFeverRodAnimation-jpg/[/img] - One Wheel (blue) - One Piston (red) - One Connection Rod (yellow) - One Coupling Rod (green) You don't need need all of the parts to make them move, if you have let's say a shunter with a coupling rod, you can only create that one. Each part should be mirrored to the other side of the locomotive so you don't need to create more models just to have the coupling rod on the opposite side at a different position (like they are in real life). You can basically have a different origin for all of your single meshes, but then you would have to enter the different positions of the mesh in the group file. Let's keep it simple and have them all set up like in the picture above. [u][b]Animating the Piston[/b][/u] Open the piston's .msh file, find [code]function data() return { animations ={ },[/code] and replace it with [code]local vec2 = require "vec2" local vehicleutil = require "vehicleutil" function data() return { animations = { drive = vehicleutil.makePistonAnim(vec2.new(X1, Y1), vec2.new(X2, Y2), vec2.new(X3, Y3)) },[/code] Replace X1 and Y1 with the position of WheelCenter in meters. Replace X2 and Y2 with the position of WheelPos0 in meters. Replace X3 and Y3 with the position of PistonPos0 in meters. In this case it's: X1 = 0 Y1 = 0.682405 X2 = 0 Y2 = 0.47 X3 = 2.26 Y3 = 0.9 Make sure you use as exact as possible values, otherwise the position of the rods won't match the position of the wheel after some time! [u][b]Animating the Coupling Rod[/b][/u] Open the coupling rod's .msh file, find [code]function data() return { animations ={ },[/code] and replace it with [code]local vec2 = require "vec2" local vehicleutil = require "vehicleutil" function data() return { animations = { drive = vehicleutil.makeCouplingRodAnim(vec2.new(X1, Y1), vec2.new(X2.Y2)) },[/code] Replace X1 and Y1 with the position of WheelCenter in meters. Replace X2 and Y2 with the position of WheelPos0 in meters. In this case it's: X1 = 0 Y1 = 0.682405 X2 = 0 Y2 = 0.47 Make sure you use as exact as possible values, otherwise the position of the rods won't match the position of the wheel after some time! [u][b]Animating the Connection Rod[/b][/u] Open the connection rod's .msh file, find [code]function data() return { animations ={ },[/code] and replace it with [code]local vec2 = require "vec2" local vehicleutil = require "vehicleutil" function data() return { animations = { drive = vehicleutil.makeConnectingRodAnim(vec2.new(X1, Y1), vec2.new(X2, Y2), vec2.new(X3, Y3)) },[/code] Replace X1 and Y1 with the position of WheelCenter in meters. Replace X2 and Y2 with the position of WheelPos0 in meters. Replace X3 and Y3 with the position of PistonPos0 in meters. In this case it's: X1 = 0 Y1 = 0.682405 X2 = 0 Y2 = 0.47 X3 = 2.26 Y3 = 0.9 Make sure you use as exact as possible values, otherwise the position of the rods won't match the position of the wheel after some time! [u][b]That's it![/b][/u] Once you import the rest of the locomotive properly, you're done. If you need any help regarding this topic, leave a comment. Choo choo!

Teilen