Application note: adding moving parts

Before you read that, make sure you have a hand-held computer in sight, prepare a sheet of paper, a pencil, a glass of water and a few tablets of aspirin. You could have an emergency. The author of this tutorial accepts no liability for any permanent damage to your intellectual faculties that could be resulting from a long exposition to this page.

Moving part instructions are performing rotations around the main axes. Most of the times, the surfaces do not hinge on the main axes. Let's take an example. The aileron is hinged on the trailing edge of the wing. The wing is very often swept backwards and affected by a dihedral angle. Therefore, to make the aileron respond to the joystick, you need to move it first in an appropriate position and then to bring it back to its initial location. You can do this with a set of nested TRANS/ROT and AILERON instructions :

The following note will show you how to proceed.

Assumptions: Let us call (x1, y1, z1) and (x2, y2, z2) the coordinates of the extremities of the aileron hinge. We have to perform :

The required angles of rotation may be calculated as follows.
Bank angle: Yaw angle: The arc-tangent may be called TAN-1 or ATAN depending on your handheld computer. Do not get confused with the signs!

Once you are finished with these preliminary calculations, create three vectors in the Graphic Editor :

Then launch the Model Editor and go to the location where you intend to insert the moving part sequence. The instructions that you have to insert are the followings :
AILR01  TRANS/ROT  AILR02
        VECTOR     x1,y1,z1,0,a1,a2
        RETURN
AILR02  AILERON    AILR03
        VECTOR     0,0,0,0,0,0
        RETURN
AILR03  TRANS/ROT  AILR04
        VECTOR     0,0,0,0,-a1,-a2
        RETURN
AILR04  TRANS/ROT  MYAILRN
        VECTOR     -x1,-y1,-z1,0,0,0
        RETURN

MYAILRN is supposed to be the name of the sub-assy which represents the aileron. The AILR04 instruction block is the "inner" translation which brings the aileron close to the origin.
The AILR03 instruction block takes care of the initial rotations.
The AILR02 instruction block performs a rotation according to the joystick position.
The AILR01 instruction block brings the aileron back to its initial location.

This is it!

Tip: by proceeding this way, you can keep the same texture support for the aileron as for the wing. Caution : if the wing sweep is too large, the calculation of the yaw angle could be inaccurate. A more complex calculation may be required.


copyright Hervé Devred, 2001