Creating New Aircraft III Landing Gear

Adding the landing gear animation is one of the most difficult parts of creating a new model or improving an existing one. There are different ways of doing this, I simply am describing what I think is the easiest way of doing this without too many tools.

Blender 2.49b

Wings 3D 1.4

DNVIEWER

The first thing to do is to import the model into Blender. We will assume it is a new model, so the model and the landing gear is imported. The landing gear is placed in Blender in the correct positions, however the landing gear - wheel, tire, strut and so on must be combined into one single object.

Step 1: Import model into Blender. This model is the fictional Stealthplane previously created in Wings 3D and exported into .lwo format. It was working in YSFlight.

The landing gear is in separate parts that must be joined using the join command in Blender. Select the first part by right clicking, then press SHIFT and hold it down and right click to select the next part. Do this for the other two gear.

Export the plane into .dnm format and open the file in DNMVIEWER if you have the program.

In any case, open up the .dnm file in a text editor.

The dnm file will consist of the following sections: several sections starting with PCK xxxxx xxx and SURF

DYNAMODEL

DNMVER 1

PCK fuselagen+blk 122

SURF

V 1.7331 -0.6534 -5.8367 R

V 3.2127 0.2034 -5.613 R

.....


There will be a section at the bottom referring to each section for animation purposes. Here we take the main fuselage element, fuselagen+black identified by changing the position values for the srf to see if it moves.

SRF "fuselagen+blk"

FIL fuselagen+blk

CLA 0

NST 0

POS -0.0000 0.0000 0.0000 0 0 0 1

CNT 0.00 0.00 0.00

REL DEP

NCH 0

END

SRF "fuselagen+black"

FIL fuselagen+black

CLA 0

NST 0

....

The fuselagen+black animation definition section contains the main element, the 'parent' and lower down the "CLD" line which lists the sub-elements, the children as specified in NCH3 (Number of Children: 3) . So we define the landing gear as sub elements or children, and list the names in quotes of the srf element that the children elements are defined as.

SRF "fuselagen+black"

FIL fuselagen+black

CLA 0

NST 0

POS 0.0000 0.0000 0.0000 0 0 0 1

CNT 0.0000 0.0000 0.0000

REL DEP

NCH 3

CLD "FrontGear+grey1"

CLD "LeftGear+grey1"

CLD "RightGear+grey1"

END

The above edits have created an indented structure showing a child relationship to the main fuselage in DNMVIEWER.

Next we highlight the LeftGear+grey1 and click the STA Control tab.



With LeftGear highlighted, click the STA Control tab


At the bottom of the DBNVIEWER, the NST box needs to be changed to 2, this will unshade the STA1 and STA2 sections

STA1 and STA2 , state 1 and state 2 for the object are now editable

In the STA1 section, set the P value to 90 and select the down radio button for landing gear and see what happens: the right landing gear rotates 90 about the axis connecting the wingtips but moves forward and down. Set the X and Y values in STA1 to follow to 3.5 and -3.5 and the retracted landing gear now is in the fuselage when retracted. Clicking the down radio button simply moves the landing gear to its original position. DNMVIEWER only highlights the extreme positions of the landing gear, so we need to move into Blender to see if it works correctly.

Import into Blender, press the SHIFT and left arrow keys then the up arrow keys until the landing gear comes down, then use the left arrow and right arrow keys to move the gear. The landing gear does retract but it moves down and out of the fuselage when doing so.

The gear moves out of the fuselage when retracting, in an arc.

The centre of rotation needs to be defined, is this the CNT value or position value?

These are the steps I tried: First, move the landing gear to the centre by changing the position values. This will show how much the landing gear is away from the centre of the model, the origin, in the X and Y (up and down) axes. The Z axis is towards the nose is pointing so that is not involved here.

Once this is done, the centre of rotation nees to be translated moved from the origin by the same amount, for example if it took and X=-2 value to bring the gear to the origin, we have to add X= + 2 to the CNT X value to specifiy the new origin. Similart for the Y.

So I have ended up with the following for X and Y and Z

2.1 -1 0

Now the initial position of the gear has to be specified, so move it to the exact same position that the centre is specified to be at

2.1 -1 0

The STA X and Y and Z values specify the relative movement to the origiin in each of these states. The gear does not really move too much in these states so leave them at zero.

Now test in Blender -it works! The landing gear is lower than it should be in down position. Higher than it should be

The right gear retracting and rotating about top hinge..

Continuing to retract the gear upwards rotating about forward axis pointing tail to nose..

Almost fully retracted, it should actually retract inwards, this will be fixed next.

The CNT (Centre) settings on the lower left are set at X=2.1, and Y= -1 and Z = 0. This means that the Z coordinate is ignored in this rotation because the rotation is around the Z axis, or equally along all points on the Z axis, it does not matter. The center of rotation is very close to the position (POS) that the item is placed in.

The plane in YSFlight, and retraction works very well.

So how do we install landing gear on a plane?

Another Example:

First, create the landing gear with the plane model and to convert all of it to .dnm file. The .dnm file structure in summary looks like what is described below.

DYNAMODEL

DNMVER 1

PCK fuselagen+blk 118

SURF

V 1.73310 -0.65340 -5.83670 R

V 3.21270 0.20340 -5.61300 R

....

F

C 30 30 30

N -0.01130 0.05380 3.81040 0.00000 0.00000 1.00000

V 9 8 11

E

....

E


PCK fuselagen+black 631

SURF

V -3.27540 -0.15300 -8.25190 R

V -3.27540 0.20340 -8.25190 R

...

E


SRF "fuselagen+blk"

FIL fuselagen+blk

CLA 0

NST 0

POS 0.0000 0.0000 0.0000 0 0 0 1

CNT 0.0000 0.0000 0.0000

REL DEP

NCH 0

END


SRF "fuselagen+black"

FIL fuselagen+black

CLA 0

...

DYNAMODEL - the type of file

DNVER 1 : version 1

PCK ... the way the object is defined, name, plus number of lines describing the surface.

V - vertices are definced

F: the faces are defined



End of face defined by vertices preceding



Another object definition, this one called fuselage+black

With Vertices and Faces (not shown)



Later on in the file, at the bottom, another definition this time used for purposes of animation. So, the lines are defined like this:

SRF + name of the object

The file it refers to

CLA - class of animation, NST number of states, then the position and CNT lines as well as the STA state defintions

The main fuselage has to have several 'children' defined NCH 3 for example, and will list the names of the children or sub objects .


SRF "fuselagen+black"

FIL fuselagen+black

CLA 0

NST 0

POS 0.0000 0.0000 0.0000 0 0 0 1

CNT 0.0000 0.0000 0.0000

REL DEP

NCH 3

CLD "LeftGear+grey1"

CLD "FrontGear+grey1"

CLD "RightGear+grey1"

END


How to make the landing gear work ? Forgoing the past steps, creating the CH values, go to the DNMVIEWER. At the start, the landing gear appears in the correct place. This is the UP position, clicking STA control and up and down does not change anything.

Make sure all STA are visible

Find the centre of rotation required - move the wheel to the origin using the POS values 1.5, 1, 0. This means the origin has to be translated the reverse of these values. Enter -1.5 , -1, 0 into the CNT boxes, making the others zero, Enter thee same values into POS and enter STA1 R 90. These simple changes result in a landing gear that moves swivels more or less about a single point, the hinge line, some adjustment is needed, however since the origin could be defined at the midpoint of the gear leg. The system works, however, and can be used to make simple animations work.

These instructions will be checked and verified. 14 June 2022.


by Neocon » Sat Jan 09, 2016 8:43 am

Apparently Ctrl + R refreshes the page instead of opening a Find/Replace box. Very annoying, after a 300 word answer with one little mistake in several lines.


Ok, let's say you build your model and you have a tail hook. The rotation point of the tail hook is located at 00.00 -0.15 -5.25, and the .srf mesh for the hook is located in that position. You set the hook to rotate backwards from its down position by 120° backwards and up. If your entry has POS 0.00 0.00 0.00 0 0 0 1 and CNT 0.0 0.0 0.0, it will rotate from the CNT point, which will end up somewhere about 25 meters from where you wanted it. You have two options: You can move the mesh of the .srf so that it is lined up for the rotation point to actually be at 0 0 0 and POS 00.00 -0.15 -5.25 , or you can do this:

POS 00.00 -0.15 -5.25 0 0 0 1

CNT 00.00 -0.15 -5.25


"CNT 00.00 -0.15 -5.25" will tell YSF that the point 00.00 -0.15 -5.25 should be treated as 0 0 0, and the POS will then tell YSF to actually place the hook at 00.00 -0.15 -5.25 .


Or something like that.

https://forum.ysfhq.com/viewtopic.php?f=223&t=8326&p=94787&hilit=DNM+file+CNT#p94787



STA # # # # # # #

The 7 numbers indicate the (y,z,x) position, (y,z,x) rotation and visibility of the SRF at each STA condition. See the STA page for more information about STAs.

https://ysflightsim.fandom.com/wiki/DynaModel_Files