Animieren von Steuerflächen bei Flugzeugen

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.

  • [lang=de]Eine kurze Beschreibung der Animation von Steuerflächen im TPF.[/lang] [lang=en]A short introduction to animating control surfaces on aircraft.[/lang]
    [b][lang=de][/b] [b]1.[/b] Dreh alle Steuerflächen AUSSER dem Seitenruder so, daß ihre gewünschten Drehachsen parallel zur x-Achse liegen. Um die X-Achse drehst du sie einfach so, daß sie "flach" liegen. Um die y-Achse drehst du sie von oben betrachtet für alles, was hinten am Profil liegt, [b]im[/b] Uhrzeigersinn, für alles, was vorne dran liegt und nach unten klappen soll (Vorflügel), [b]gegen[/b] den Uhrzeigersinn. [b]2.[/b] Schreib dir für jede Steuerfläche auf, um wie viel Grad du sie aus ihrer Ursprungsposition um beide Achsen verdreht hast - 1/10 Grad reicht als Genauigkeit. [b]3. [/b]"Apply Rot/Scale" auf alle so zurechtgedrehten Flächen. [b]4.[/b] Exportieren. Wenn du es richtig gemacht hast, dann sieht das Modell im Model Viever so aus wie die 707 hier. [attach=116338][/attach] [b]5.[/b] Öffne die .mdl von deinem Modell. [b]6.[/b] Schreibe gleich als erste beide Zeilen vor alles andere das hier: [code]local vec3 = require "vec3" local transf = require "transf"[/code] [b]7. [/b]Such dir die Blöcke raus, in denen die zu animierenden Teile definiert werden. Die sehen so aus: [code]{ id = "vehicle/(Typ)/(Name)/(Name des Teils).msh", transf = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0,}, type = "MESH", },[/code] [b]8.[/b] Ersetze den Block "transf = {...", also die ganze Zeile 3 im obigen Code mit folgender Zeile: [code]transf = transf.rotZYXTransl(transf.degToRad(Alpha, Beta, Gamma), vec3.new(x, y, z, 1.0)), [/code]Die Variablen erhalten folgende Zahlenwerte: x, y, z: die Zahlenwerte x, y, z aus der ersetzten Zeile "transf = {..." von oben, Alpha, Beta, Gamma: die gemerkten Werte, um die du die Steuerflächen um die Z-, Y- und X- Achse gedreht hast; logischerweise mit umgekehrtem Vorzeichen, um die Flächen wieder zurückzudrehen. [b]9.[/b] Speichern und im Model Viewer nachsehen, ob die Fläche richtig sitzt :) Wenn die Flächen dann in der .mdl richtig angesprochen werden, dann sollten sie im TPF dann auch animiert sein. Oben habe ich die Ausnahme Seitenruder schon angesprochen. Der Unterschied zu allen anderen Rudern ist, daß dessen Drehachse parallel zur Z-Achse, also zur Vertikalen, gedreht werden muß. Der entsprechende Winkel kommt dann so in die "transf"-Zeile: [code]transf = transf.rotZYXTransl(transf.degToRad(0,-Winkel,0), vec3.new(x, y, z, 1.0)),[/code] Es ist möglich, die Steuerflächen in der .mdl mehrfach anzusprechen und verschiedene Bewegungen zu überlagern. Gelegentlich wird man zum Beispiel das Höhen- und Querruder in einer Steuerfläche kombinieren wollen: die Concorde, die Tu-144 und viele Militärflugzeuge verwenden diese technische Lösung. Das sieht in der .mdl so aus: [code]configs = { { aileronLeft = { ids = { 6, 7, 8, 9, }, maxAngle = 5.0, }, aileronRight = { ids = { 10, 11, 12, 13, }, maxAngle = 5.0, }, elevator = { ids = { 6, 7, 8, 9, 10, 11, 12, 13, }, maxAngle = 10.0, }, }, },[/code]Wie man sieht, sind die Teile 6 bis 9 als linkes Querruder und die Teile 10 bis 13 als rechtes definiert. Die Teile sind dann im nächsten Block gleich nochmal als Höhenruder angesprochen. Im Spiel werden dann die Ausschläge für beide Ruder aufsummiert und die Steuerflächen schlagen entsprechend aus. Man kann auch verschiedene Ruder verschieden stark ausschlagen lassen. Wenn man zum Beispiel ein inneres Hochgeschwindigkeitsquerruder nur um 5 Grad und das äußere um 10° ausschlagen lassen möchte, dann setze man den Ausschlagwinkel auf 5° und spreche das äußere Querruder zweimal an (11,11,...). Für jeden Aufruf bekommt die Steuerfläche den bemessenen Ausschlag zugewiesen. [b][/lang][/b] [lang=en] A short tutorial on how to animate control surfaces on aircraft. [b]1.[/b] Turn all the surfaces EXCEPT for the rudder to get their axes lying in parallel to the grand X axis. About the X axis you can just turn them to get them to lie flat. About the Y axis it depends on the part. Parts situated to the rear of the airfoil generally need to be moved clockwise viewed from top. Slats typically need to be turned counterclockwise. Kruger flaps that move in the opposite direction to normal slats will be turned clockwise obviously. [b]2.[/b] Take note of the precise angle You applied to the parts about all relevant axes. A tenth of a degree is typically sufficient in accuracy. A sheet of paper and a pen is recommended. [b]3.[/b] "Apply Rot/Scale" to all the surfaces to be animated. [b]4.[/b] Export the surfaces to the relevant directories. If done right, the model should look similar to the 707 in the Model Viewer: [attach=116338][/attach] [b]5.[/b] Open your models .mdl file. [b]6.[/b] RIght in front of everything else, paste the following two lines: [code]local vec3 = require "vec3" local transf = require "transf"[/code] [b]7.[/b] Look up the lines defining the parts You would like to be animated. They look like this and are usually found in the 2nd third of the file: [code]{ id = "vehicle/(Type)/(Name)/(Part name).msh", transf = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0,}, type = "MESH", },[/code][b]8.[/b] Replace the line "transf ={" etc. with the following: [code]transf = transf.rotZYXTransl(transf.degToRad(Alpha, Beta, Gamma), vec3.new(x, y, z, 1.0)), [/code]The variables will take the following values: Alpha, Beta, Gamma: the angles You have noted down for the part previously, obviously with negative value (you need to turn the parts back now), about the Z, Y and X axes. x, y, z: the coordinates of the part in the model as taken from line 3 under point 7. Just copy and paste those. [b]9.[/b] Save the file and check the Model Viewer to see if the parts are in the right position again. If you have adressed those parts properly further down in the .mdl (or via the Blender export plugin), they ought to be animated now. Earlier, I have named the rudder as the exception to these guidelines. This surface is not turned in parallel to the X, but in parallel to the Z axis, or the Vertical, if you will. Again, note the angle and apply Rot/Scale. The proper line for the rudder looks as follows in the .mdl: [code]transf = transf.rotZYXTransl(transf.degToRad(0,-angle,0), vec3.new(x, y, z, 1.0)),[/code]Another note: It may become desirable to apply various animations to one surface. On occasion, an elevator might double up as an aileron (various military types, Tu-144, Concorde), or an aileron might be deflected down together with the flaps. This is possible in the game as well. Just call up the parts multiple times in the .mdl: [code]configs = { { aileronLeft = { ids = { 6, 7, 8, 9, }, maxAngle = 5.0, }, aileronRight = { ids = { 10, 11, 12, 13, }, maxAngle = 5.0, }, elevator = { ids = { 6, 7, 8, 9, 10, 11, 12, 13, }, maxAngle = 10.0, }, }, },[/code]Note how parts 6 to 9 are nominated as left aileron and parts 10 to 13 as right aileron. Then, they are all called up again as elevators in the next block. The game will sum up both deflections and apply the total to the surface at any time. It is also possible to have one part deflect more than another one: just set the deflection angle to the value appropriate for the less moving part and adress the part you want to deflect more strongly twice or thrice. The parts total deflection will be n times the maximum angle, with n being the number of calls. This is useful for high and low speed ailerons for example. [/lang]

Teilen