Adding moving parts to an R.F.O.

We will add moving parts to the model: a propeller, the gears with the well doors, the ailerons, the elevators and the rudder. Actually, adding a flight control surface is a common process whatever the surface you are dealing with. A thorough explanation for each of them could be pretty boring! I will give you a complete explanation for the aileron and then I suggest that you have a look at the "MyRFO.3DM" file which is in this tutorial directory for the other ones. In that way, it won't be that bad!

The propeller

The propeller will be composed of:

It will be stored into a dedicated sub-assy called "PROP".

In the MyRFO project, create this PROP sub-assy. Select the front view and set the current plane to y = 6.500. In the Desk sub-assy, create a shape of the hexagon kind the center of which is located in:
      0.000  6.5000  0.000
Give it a radius of 0.400 ft. Validate by clicking on the draw button.

We are going to build the prop shaft with the build cylinder menu option. Activate this option. Set the coordinate of the vector to:
      0.000  1.5000  0.000
Select the PROP sub-assy in the destination sub-assy list-box and validate. This is the first part of the shaft. Go back to the Desk sub-assy. The selected polygon should be the hexagon that was created to support the cylinder. It is contained in a plane parallel to xOz with a y=8.000 coordinate. Activate again the build cylinder menu option. This time, set the the coordinates of the vector to the following values:
      0.000  1.000  0.000
Select the PROP sub-assy in the destination sub-assy list-box and validate. The generation of this second cylinder has created a third hexagon in a plane parallel to xOz with a y=9.000 coordinate which is stored in the Desk sub-assy. To complete the design, we have to move this hexagon into the PROP sub-assy and flip it.

Launch the Model Editor and go to the PROP code page. Insert a GCOLOR instruction at the beginning of the list and assign it the black color (index = 1). Transform all the TPOLY instructions into GPOLY instructions. Insert a RETURN instruction at the end of the list (yes, I know, there is already one... You will understand later on why I am asking you to add another one). Exit the Model Editor. That's it for the shaft.

Let's deal with the propeller blades now. In the Graphic Editor front view, set the current plane "y" coordinate to 8.000. Activate the chain creation mode and create a polygon with the following vertices:
      0.000  8.000  0.000
      0.400  8.000  0.800
      0.400  8.000  2.600
      0.000  8.000  3.000
      -0.400  8.000  2.600
      -0.400  8.000  0.800
Check that the PROP sub-assy is selected and validate. This is the front shape of the blade. Activate the Draw/Rotate chain menu option. Check that the current axis of rotation is Oy and set the coordinates of the center of rotation to:
      x = 0.000  z = 0.000
Enter 120.0 in the rotation angle data field and validate by clicking on the dupl.+rot. button. This is the front shape of the second blade. Do it again to create the front shape of the third blade.

We are finished with the front view of the prop, we need now to create the rear view of it. Activate the multiple selection mode (nineth button of the tool bar or Selection/Multiple selection menu option). Cycle through the PROP polygons with the C key. Each time you select a blade, press the space bar. Once you have selected the three of them (that is when the three of them are highlighted in green or in yellow), activate the Selection/Copy/Translate menu option. Enter a vector with three zero coordinates and validate by pressing the dupl(2) button. Activate then the Selection/Flip menu option to have the three polygons of the selection oriented backwards. Exit the multiple selection mode (depress the nineth button of the tool bar).

Launch the Model Editor and go to the PROP code page. You can see that the six polygons associated to the blades are added BELOW the RETURN instruction that we have inserted a few minutes ago. Insert a GCOLOR instruction just after this RETURN instruction (that is just before the 6 polygons figuring the blades) and assign it an orange color (index=8). Transform all the blade polygons into GPOLY instructions. As we did before, add a RETURN instruction at the end of the list and exit the Model Editor.

We will now create the transparent disk that will figure the prop at high speed. Check that you are in the front view and that the current plane "y" coordinate is set to 8.000 ft. Select the PROP sub-assy if it is not. Activate the Draw/Shape.../Circle.../16 points menu option. Enter the coordinates of the center:
      0.000  8.000  0.000
and the radius of the circle: radius = 3.000
Validate. Activate the Draw/Copy/Translation menu option. Enter a vector with three zero coordinates and validate by pressing the dupl.+move button. Activate then the Draw/Flip menu option to have the duplicated polygon oriented backwards. May I ask you to define the selected disk as a texture support? You will understand why in a few moments.


Launch the Model Editor and go to the PROP code page. The two disks appear at the end of the list. We could insert a GLASS instruction to have the prop appearing as a transparent disk but I have a better idea. We will use the alpha blending feature that was introduced with FS2000™. Therefore, let's introduce a TEXTURE/LIMITS pair of instructions just before the two last polygon instructions. Assign to the TEXTURE instruction the "PILOT" file with the half1 and front options. Double-click on the data field of the LIMITS instruction and select the disk that you have just defined as a texture support. Transform the two TPOLY instructions into BPOLY instructions.

We will now activate the alpha blending mode. Select the first BPOLY instruction and insert a BLENDING instruction (Color/Texture group, Alpha blend option). Assign it an index of 80. The alpha blending mode has something special: once it is activated, it remains ON as long as you do not swith it off. I strongly recommend you to switch it off as soon as you are finished with the alpha blended part. Let's insert a BLENDING instruction at the end of the list and give it the 0 index.
        TEXTURE    Pilot
        LIMITS     -3.000,3.000,-3.000,3.000
        BLENDING   80
        BPOLY      16;...
        BPOLY      16;...
        BLENDING   0
        RETURN

Look now at the whole code page. There are three blocks of instructions, two of them are beginning with a GCOLOR instruction and the third one with a TEXTURE instruction. The three of them are ending with a RETURN instruction. You can think of them as three subroutines. To complete the prop design, we need to add a few instructions to "call" these subroutines. Go to the beginning of the list and add a GOSUB instruction. Have it pointing at the first GCOLOR instruction (which is at the moment just below it). Give to this GCOLOR instruction the "SHAFT" label. This will display the shaft.

Concerning the blades and the transparent disk, we don't want them to be displayed at the same time. We would like to see the blades at low prop speed and the disk at high speed. A JUMP PROP instruction will help us to do that. Insert a JUMP PROP instruction just after the GOSUB one. Actually, the JUMP PROP instruction is part of a combined pair of instructions. It is associated with a RANGE instruction which allows you to define the conditions of the test. Double-click on the data field of the RANGE isntruction to set the min. and max. value to:
      min. = 0  max. = 35
Have the JUMP PROP instruction pointing at the TEXTURE instruction. Give the "DISK" label to the TEXTURE instruction. Insert then another GOSUB instruction after the RANGE one and insert a RETURN instruction after this second GOSUB. Have the GOSUB instruction pointing at the second GCOLOR instruction. Give the "BLADE" label to this instruction. The instruction list should eventually look like this:
PROP    SUBASSY,T  click to come back
        GOSUB      SHAFT
        JUMP PROP  DISK
        RANGE      0,35
        GOSUB      BLADE
        RETURN
SHAFT   GCOLOR     1
        GPOLY      4;...
        GPOLY      4;...
        ...
        RETURN
BLADE   GCOLOR     8
        GPOLY      6;...
        GPOLY      6;...
        ...
        RETURN
DISK    TEXTURE    Pilot
        LIMITS     -3.000,3.000,-3.000,3.000
        BLENDING   80
        BPOLY      16;...
        BPOLY      16;...
        BLENDING   0
        RETURN

Let us take a few moment to better understand it. It is composed of four sections:

The main code section can be read as a small programme. It starts with the SUBASSY,T declaration. Then it calls for the SHAFT module which is displayed in any case. The following instruction is a test instruction: if the prop speed is within the limits defined by the RANGE inntruction, the BLADE module is called by a GOSUB instruction and then the sub-assy "programme" is ended by a RETURN instruction. If it is not, the "programme" jumps to the DISK module which is ended by a RETURN instruction. The two first modules starts with a GCOLOR instruction and the third one with a TEXTURE instruction. The third module features an alpha blending sequence. Each of the three modules ends up with a RETURN instruction.

We will try now to make the prop running. Go back to the main code page. The rotation of the prop is achieved through an instruction of the advanced group. Insert it just before the DICE SUBASSY,T instruction. As you can see, it is a combined pair of instructions: RUN PROP/VECTOR. The RUN PROP instruction is a subroutine call: have it pointing at the PROP sub-assy. The meaning of the VECTOR instruction will be defined later in this tutorial.

To complete the list, add a RETURN instruction just after the VECTOR one. Then, add a GOSUB instruction just after the GOSUB GOTAIL one. Double-click on the data field of the instruction you have created and point at the RUN PROP instruction. Give the "PROP1" label to the RUN PROP instruction. The instruction list should now look like this:
MYRFO   MASTER
        GOSUB      DICE
        GOSUB      CANOPY
        GOSUB      PILOT
        GOSUB      RWING
        GOSUB      LWING
        GOSUB      GOTAIL
        GOSUB      PROP1
        RETURN
PROP1   RUN PROP   PROP
        VECTOR     undefined translation
        RETURN
DICE    SUBASSY,T  click to open sub-assy
CANOPY  SUBASSY,T  click to open sub-assy
PILOT   SUBASSY,T  click to open sub-assy
RWING   SUBASSY,T  click to open sub-assy
LWING   SUBASSY,T  click to open sub-assy
GOTAIL  INSERT     TAIL
PROP    SUBASSY,T  click to open sub-assy
        ENDBLOCK

The meaning of it is detailed just below. It is composed of three parts:

The main section is a sequence of "subroutine" calls (GOSUB). 5 of them are directly calling a sub-assy. One of them is calling an assembly. The last one is calling a short module, labeled PROP1. This PROP1 module is composed of a RUN PROP/VECTOR instruction pair and is ended by a RETURN instruction. The RUN PROP instruction is a subroutine call which is pointing at the PROP sub-assy. As you can see, the VECTOR instruction is still undefined.

The moving part instructions are a little bit tricky. They are controlling a movement around one of the three axes: Ox, Oy or Oz. The sad thing is... the moving parts are scarcely geared around one of these axes. There are two ways to deal with this issue. The first one is to use the associated VECTOR instruction, the second one is to use a TRANS/ROT instruction. We will see later on how to use this TRANS/ROT instruction. At the moment, we do not have to worry about this: the axis of rotation of the prop is the right one. The only thing we have to do is to specify a null VECTOR.

Exit the Model Editor. Create a vector with three zero coordinates (Utilities/Make a vector menu option or CTRL+F4 key). Launch the Model Editor again. Double-click on the data field of the VECTOR instruction and click on one of the arrows of the VECTOR parameters input window. The null vector that we have created is selected. Accept the other settings (which are null either) and validate. The VECTOR instruction is updated as below:
        VECTOR     0.000,0.000,0.000,0.000,0.000,0.000

That's it for the prop! If FS2000™ is running, check that MYRFO is not the selected aircraft. If FS2000™ is not running, launch it. Compile the model. Have a look at the result and test the prop.


That's cool, isn'it?

The aileron

Installing an aileron follows the same process as for the prop. Yet, this time we will have to juggle with this TRANS/ROT instruction that I told you about a few moments ago since the hinge of the aileron is not the Ox axis. Let's start with the aileron 3D model.

Exit the Model Editor. Create a new sub-assy called "RAILERON". In this sub-assy, create a new polygon with the following vertices:
      12.000  -4.500  0.000
      20.000  -4.500  0.000
      20.000  -6.000  0.000
      12.000  -6.000  0.000
Duplicate this polygon and flip the duplicated polygon. This is a very basic aileron, isn't it? Let us now take a few moment to think about the aileron movement.

The moving part instructions, as I told you, deal with parts hinged on one of the main axes. This is not the case with the aileron that we have designed. Hopefully, there is an instruction that allows you to change the location of the origin and the orientation of the axes: this is the TRANS/ROT instruction. The exact meaning of this instruction (actually, it is part a combined pair of instructions since it is associated to a VECTOR one) is explained in the Help file. In our case, the aileron hinge is parallel to the Ox axis and this will make things simpler.

Instruction Axis Moving part
RUN PROP
Oy
propeller
RUN PROP2
Oy
propeller #2
RUN PROP3
Oy
propeller #3
RUN PROP4
Oy
propeller #4
R AILERON
Ox
right aileron
L AILERON
Ox
left aileron
RUDDER
Oz
rudder
STABILIZER
Ox
stabilizer/elevator
MOVE FLAP
Ox
flap
SPOILER
Ox
spoiler
GEAR RBANK
Oy
right gear (retraction -> left)
GEAR LBANK
Oy
left gear (retraction -> right)
GEAR ELEV
Ox
gear (retraction -> fore)
GEAR ELEVR
Ox
gear (retraction -> aft)
WDOOR Ox
Ox
gear door (retraction -> fore)
WDOOR Oxr
Ox
gear door (retraction -> aft)
WDOOR ROy
Oy
gear door (retraction -> left)
WDOOR LOy
Oy
gear door (retraction -> right)
WHEEL
Ox
wheel rotation

Remark #1 : some of these instructions cannot be selected directly from the instruction panel. They are part of instruction sub-groups. To cycle through the various instructions of a sub-group, you need to press a given key of the keyboard. For instance, to select the RUN PROP2 instruction, first insert a RUN PROP one, validate and then press the P key. To learn more about the keyboard short-cuts, press the F10 key while you are in the Model Editor.

Remark #2 : for the RUN PROPx instructions to be active, the *.air file needs to comply with the FS2000™/CFS2™ standard. The RUN PROP instruction is compatible with the former FS98™/CFS™ *.air file standard.

The principle of operation is the following:

To do that, we will need two translation vectors: the first one to move the aileron to the origin, the second one to move it back. Let us create them. Use the Utilities/Make a vector menu option twice to create the two following vectors:
      12.000  -4.500  0.000
      -12.000  4.500  0.000

Launch the Model Editor and go to the RAILERON code page. Insert a GCOLOR instruction, assign it a blue color (index=7) and transform the polygon instructions into GPOLY ones. Once you are finished, go back to the main code page. Insert the following sequence just before the DICE SUBASSY,T instruction:
        TRANS/ROT  ?
        VECTOR     undefined translation
        RETURN
        R AILERON  ?
        VECTOR     undefined translation
        RETURN
        TRANS/ROT  ?
        VECTOR     undefined translation
        RETURN
The R AILERON instruction is to be found within the Flight controls instruction group, the TRANS/ROT instruction within the misc. advanced instruction group. This sequence is composed of three modules. We will arrange them in order to have the first module calling the second one, then the second module calling the third one and eventually the third module calling the RAILERON sub-assy.

Let's complete the third module (the last one). Have the TRANS/ROT instruction pointing at the RAILERON sub-assy. Then double-click on the data field of the VECTOR instruction. Use the arrows in order to select the vector defined by the following coordinates:
      -12.000  4.500  0.000
This module performs the translation of the aileron to the origin.

Let's now complete the second module. Double-click on the data field of the RAILERON instruction and point at the TRANS/ROT instruction in the third module. Give it the "RAIL1" label. Then double-click on the data field of the VECTOR instruction. Use the arrows in order to select the null vector which was defined when we were designing the prop. This module achieves the rotation of the aileron according to its current position.

Finally, let's complete the first module. Have the TRANS/ROT instruction pointing at the RAILERON instruction. Give it the "RAIL2" label. Then double-click on the data field of the VECTOR instruction. Use the arrows in order to select the vector defined by the following coordinates:
      12.000  -4.500  0.000
This module performs the translation of the aileron back to its inital location.

We must now call this sequence from the main section of the instruction list. Insert a GOSUB instruction just after the GOSUB PROP1 instruction. Double-click on its data field and point at the first TRANS/ROT instruction. Give it the "RAIL3" label. The instruction list should now look like this:
MYRFO   MASTER
        GOSUB      DICE
        GOSUB      CANOPY
        GOSUB      PILOT
        GOSUB      RWING
        GOSUB      LWING
        GOSUB      GOTAIL
        GOSUB      PROP1
        RETURN
PROP1   RUN PROP   PROP
        VECTOR     0.000,0.000,0.000,0.000,0.000,0.000
        RETURN
RAIL3   TRANS/ROT  RAIL2
        VECTOR     12.000,-4.500,0.000,0.000,0.000,0.000
        RETURN
RAIL2   R AILERON  RAIL1
        VECTOR     0.000,0.000,0.000,0.000,0.000,0.000
        RETURN
RAIL1   TRANS/ROT  RAILERON
        VECTOR     -12.000,4.500,0.000,0.000,0.000,0.000
        RETURN
DICE    SUBASSY,T  click to open sub-assy
CANOPY  SUBASSY,T  click to open sub-assy
PILOT   SUBASSY,T  click to open sub-assy
RWING   SUBASSY,T  click to open sub-assy
LWING   SUBASSY,T  click to open sub-assy
GOTAIL  INSERT     TAIL
PROP    SUBASSY,T  click to open sub-assy
RAILERONSUBASSY,T  click to open sub-assy
        ENDBLOCK

It's time to compile and have a look at the result.


As you can imagine, adding the left aileron, the rudder and the stabilizers requires the same kind of operations. Guiding you step by step into the detailed design of these moving surfaces would be a boring stuff for both of us. I suggest you that we skip this phase. You can find in the directory of this tutorial the "MyRFO.3DM" file of the complete model. If you want any more deatils, do not hesitate to have a look at it.


Remark : the flight control surface movement can be trimmed thanks to the Settings option of the Model Editor menu. This option can be activated only when you are in the master project.

The gears

I guess you won't disagree if we do it as simple as possible. Anyway, if you do, this is not an interactive tutorial... Go back to the Graphic Editor and select the top view. Create a new sub-assy and call it "RGEAR"... What? ... Do not harrass me with your question. RGEAR stands for "Right GEAR".

Activate the Draw/Shape.../diamond menu option. Check that the top view is selected. Set the shape center coordinates to:
      10.500  1.500  0.000
and then set the height and width to 0.8000 ft. Validate (draw button).
Activate the Draw/Build cylinder menu option. Set the vector coordinates to:
      0.000  0.000  -4.000
Keep RGEAR as the destination sub-assy and validate. That's for the strut.

Select the side view. Activate the Draw/Shape.../Circle.../16 points menu option. Set the shape center to:
      10.900  1.500  -4.000
and then set the radius of the circle to 2.000 ft. Validate. Duplicate this circle and flip the duplicated circle. Define one of the two circles as a texture support.

Launch the Model Editor and go to the RGEAR code page. There are 7 polygons. The first one is the basis of the strut. Let's transform it into a HIDDEN polygon. The 4 following polygons are figuring the strut. Let's transform them into GPOLY polygons. We will keep the two last ones as they are. Go to the beginning of the list. Insert a GCOLOR instruction with an index of 2 (grey). This is for the strut. Then insert a TEXTURE/LIMITS instruction. Assign to the TEXTURE instruction the "PILOT" file with the half1 option. Double-click on the data field of the LIMITS instruction and select the circle you have just defined as a texture support.

We are done with the gear. Let's deal with the gear well door. Create a new-sub-assy and call it RWELL. While you are in the side view, set the current plane to x=11.000 and press the enter key. Activate the chain creation mode. Create a polygon with the following vertices:
      11.000  2.000  0.000
      11.000  3.400  -3.200
      11.000  1.500  -4.200
      11.000  0.000  -3.700
      11.000  0.800  0.000

Duplicate the created polygon and flip the duplicated one. Launch the Model Editor and go to the RWELL code page. Insert a GCOLOR instruction with an index of 3 at the beginning of the list and transform the TPOLY instructions into GPOLY instructions.

We will now make the gear move. You know how to deal with parts which are not aligned with on of the main axes. Go back to the Graphic Editor and create 4 vectors with the following coordinates:
      10.500  0.000  0.000
      -10.500  0.000  0.000
      11.000  0.000  0.000
      -11.000  0.000  0.000

Launch the Model Editor and stay in the main code page. Click on the DICE SUBASSY/T instruction and insert the following sequence:
        BANK RGEAR ?
        VECTOR     undefined translation
        RETURN
        TRANS/ROT  ?
        VECTOR     undefined translation
        RETURN

Have the instructions pointing at the right address and select the appropriate vectors:
        BANK RGEAR RGEAR1
        VECTOR     10.500,0.000,0.000,0.000,0.000,0.000
        RETURN
RGEAR1  TRANS/ROT  RGEAR
        VECTOR     -10.500,0.000,0.000,0.000,0.000,0.000
        RETURN

As you can see, we simplified the sequence by omitting one of the TRANS/ROT instructions. This is because there is no rotation to have the gear hinge aligned with one of the main axis. We could do that for the flight control surfaces, but now it's too late...

Let's do the same kind of thing for the gear well door:
        WDOOR ROy  RWELL1
        VECTOR     11.000,0.000,0.000,0.000,0.000,0.000
        RETURN
RWELL1  TRANS/ROT  RWELL
        VECTOR     -11.000,0.000,0.000,0.000,0.000,0.000
        RETURN

To insert the WDOOR ROy, insert a WDOOR xxx instruction (misc. advanced group, wheel door option). Then select the code field of the inserted instruction and press twice on the W key. It will make you cycle throught the different options available for this instruction.

To complete the right gear design you still need to insert two GOSUB instructions at the end of the main section of the list (just after the GOSUB LAIL3 one) and have them calling the two small modules that you have just created. Let's call RGEAR2 and RWELL2 these modules.
        GOSUB       PROP1
        GOSUB       RAIL3
        GOSUB       LAIL3
        GOSUB       RGEAR2
        GOSUB       RWELL2
        RETURN
        ...
        ...
RGEAR2  BANK RGEAR RGEAR1
        VECTOR     10.500,0.000,0.000,0.000,0.000,0.000
        RETURN
RGEAR1  TRANS/ROT  RGEAR
        VECTOR     -10.500,0.000,0.000,0.000,0.000,0.000
        RETURN
RWELL2  WDOOR ROy  RWELL1
        VECTOR     11.000,0.000,0.000,0.000,0.000,0.000
        RETURN
RWELL1  TRANS/ROT  RWELL
        VECTOR     -11.000,0.000,0.000,0.000,0.000,0.000
        RETURN

Doing the same thing with the left gear is a piece of cake now that you are an AD 2000 wizard. Let's skip this stuff and look at the final result in the air.


He, guys, you know what?
...
This is it!
You've got your AD 2000' designer graduation.
Congratulation!

Remark : For those who want an even more realistic model, the WHEEL instruction allows them to simulate the wheel rotation on the ground. It is a moving part instruction as the other ones. The wheel axis and center of rotation being different from the gear hinge, the WHEEL instruction must be nested in the gear movement instruction sequence. The *.3dm file which is provided to illustrate this tutorial shows you how to proceed.


copyright Hervé Devred, 2001