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 :
Assumptions: Let us call (x1, y1, z1) and (x2, y2, z2) the coordinates of the extremities of the aileron hinge. We have to perform :
Once you are finished with these preliminary calculations, create three vectors in the Graphic Editor :
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.