New aircrafts for Aerofly Professional
Workshop by rodeo

 v1: 26.05.2002

Setup:

For a new afpro model you have to create a new subdirectory in the \aircraft folder.
Set the same name for the directory and all the included files.
Avoid any problematic characters like blanks, german umlauts or any others.
Additionally copy the tmg amd tmd file from an existing similar aircraft to your new directory,
and rename them for further use.

This is the final structure:
  \aircraft\newmodel\
               newmodel.bmp
               newmodel.obj
               newmodel.tmg
               newmodel.tmd
               thumb.bmp

eventually:
  \sound\newmodel.wav




A. Graphics construction

For a new aircraft in aerofly professional we need an 3D framework.
Let me suggest the program Metasequoia LE for the 3D construction.
These are my reasons to prefer it:
  It is FREEWARE, no legal problems
  It is easy to use 
  It can do many operations you need for model construction
  It is slim and does not contain other stuff you don't need (animations...)
  We have a converter for easyfly/piccofly/afpro



Find the download link to Metasequoia LE here:
  http://www1.sphere.ne.jp/mizno/main_e.html

An english workshop is published here:
  http://www.interq.or.jp/japan/cyber/fms/Metasequoia_e.htm
This page also contains links to german or french versions of the workshop



Follow these rules when creating a 3D model:
  - You must create single objects for the main parts of your aircraft.

  - If you have additional graphics like extra fuel tanks, weapons or other parts also create new objects. 
     Later in the tmg file we can treate them as subobjects.

  - Each object can have just one bitmap cover. Do not place more than 1 cover definition or separate colour on an object, 
     otherwise it will be separated into different objects which can cause some confusion.

  - All moving parts must be separate objects (ailerons, flaps, elevators, rudders, gears, wheels).

  - All moving parts must consist of closed polygons. So if you cut out an aileron from a wing, make sure you place a face 
     on the open front side of the aileron. This is vital for afpro, because it uses this face to calculate the rotation axis of the part.

  - You may need a propeller for your model. Create blades with a pitch of about 20 degrees.
     Make sure it rotates into correct direction.

  - Open the tmg file to see the names you should use for your model parts

  - An object called 'Fuselage' must be present


Use any drawing program for the creation of your bitmap file, e.g. Microsoft Paint.
I want to recommend Pixia to you, because it is a FREEWARE program like Metasequoia LE.
  http://www.tacmi.co.jp/pixia/


Specifiy your bitmap as a square file with 24 bit colour depth, like 256x256x24 bpp or 512x512x24 bpp.

Check Metasequoia workshops how to place the bitmap on the 3D framework.
Additionally you can use Meta LE to make the thumb nail image for the aircraft selection window in afpro.
Inside Metasequoia LE display your aircraft with covering and make a snapshot.

Tip: You can add a background image to modify the colour of the background, 
you can switch off display of axes and grids, you can switch off display of lines and vertices.
This gives a perfect view of your work. 

Paste your snapshot into your drawing program and resize it to 64x64 pixels. Save it as 'thumb.bmp' into your new directory.



Conversion to afpro obj file is done by a program which is available separately from IPACS.





B. TMG - the graphics definition file


This file is used to define all objects which should be visible in afpro.
A part in the obj file which is not defined in the tmg will not show up.
The tmg file uses an excellent tree structure for the object definition.

As mentioned already above copy an existing tmg file from an aircraft which is similar to your new aircraft 
and then start to modify and check the data.



The tree structure can be explained with 3 examples.

1. Definition of single main objects

Append tmgeometricobject LeftGear                                                        main object
cd LeftGear/
Geometry( "aircraft/rF86/rF86.obj", "Leftgear" )

cd ../                                                                                                        back to root

Append tmgeometricobject RightGear                                                       main object
cd RightGear/
Geometry( "aircraft/rF86/rF86.obj", "Rightgear" )

cd ../                                                                                                         back to root

Append tmgeometricobject FrontGear                                                       main object
cd FrontGear/
Geometry( "aircraft/rF86/rF86.obj", "Frontgear" )

cd ../                                                                                                        back to root





2. Definition of a sub object

Append tmgeometricobject Stabilizer                                                        main object
cd Stabilizer/
Geometry( "aircraft/rJungmeister/rJungmeister.obj", "Stabilizer" )

Append tmgeometricobject Rudder                                                          sub object
cd Rudder/
Geometry( "aircraft/rJungmeister/rJungmeister.obj", "Rudder" )

cd ../                                                                                                        back to main object

cd ../                                                                                                        back to root

Append tmgeometricobject TailGear                                                         main object
cd TailGear/
Geometry( "aircraft/rJungmeister/rJungmeister.obj", "Tailgear" )

cd ../                                                                                                        back to root




3. Definition of multiple sub objects

Append tmgeometricobject Fuselage                                                         main object
cd Fuselage/
Geometry( "aircraft/rRaceRat/rRaceRat.obj", "Fuselage" )

Append tmgeometricobject Glass                                                             sub object
cd Glass/
Geometry( "aircraft/rRaceRat/rRaceRat.obj", "Glass" )

cd ../                                                                                                        back to main object

cd ../                                                                                                        back to root

Append tmgeometricobject Propeller                                                        main object
cd Propeller/
Geometry( "aircraft/rRaceRat/rRaceRat.obj", "Propeller" )

Append tmgeometricobject Blade1                                                           sub object
cd Blade1/
Geometry( "aircraft/rRaceRat/rRaceRat.obj", "Blade1" )

cd ../                                                                                                        back to main object

Append tmgeometricobject Blade2                                                           next sub object
cd Blade2/
Geometry( "aircraft/rRaceRat/rRaceRat.obj", "Blade2" )

cd ../                                                                                                        back to main object

cd ../                                                                                                        back to root




Follow these rules:
  - You must define all objects from the obj file to be shown in afpro.

  - You must exactly specify the tree structure otherwise afpro will fail.

  - Make sure that your last commands cd../ lead back to the root ( so there can be 1 or 2 command lines necessary. 
     This depends on your last object with or without sub objects).

  - Be aware that the object definition name can be different from the name used in the obj file.

  - To avoid confusion try to use the same names in both files.

  - Since the names in the tmg file should not be altered (except you know exactly what you're doing)
     you have to use this names in the obj file.

  - Pay attention to capital or small characters, this is vital for the definition.

Tip: If your obj, bmp and tmg files are correct, afpro will show your complete aircraft after selection on the main screen. 
If a part is not displayed your definition contains an error.





C. TMD - the flight model data

The tmd file contains several sections of data.
First section is the joint section and definition of all objects relevant for the flight model. 
This includes definition of connected objects, graphic objects, but also of servos and receiver.
Then there is the data part of the joints.
The third part is the data part of all other objects.

You should copy the tmd file from the same aircraft you used the tmg file.
This makes sure that all object definitions fit together.

It is absolutely vital, that your tmd file follow the structure of your tmg file.
Otherwise afpro will crash when loading the data.


Follow these rules for the tmd file:
 
- All objects which are defined in the tmg file should be included in the tmd file.

  - Check your spelling because the name of the objects have to be congruent.

  - All main objects have to be attached by the joints, otherwise they will fall apart from your model.

  - All main parts have to be defined according to your tmg file.

  - A part with a moving object (e.g. wing with aileron) has to include a line for the moving part.

  - Also it has to have a line for the appropriate servo.

  - For a moving part a servo object must exist.

  - An engine must always exist even if there is no graphic presence of this object.



Tip: When you've done all these steps, load your aircraft in afpro and select the edit function.
This shows you the main parts and lets you set weight, engine power, center of gravity ...
Do not yet try to fly your model. Exit afpro and open the tmd for further editing.


Tip: If your geometry of moving parts is correct, afpro automatically calculates the rotation axis.



Tip: For the next steps, we have to enter some coordinates. 
Open your obj file, check the xyz-values of the selected object to find the appropriate values.


Joints: 
If rigid =1 the parts cannot break apart, if set to 0 we must define the attachment forces.

  cd JointFuselageEngine/
  Rigid = 1



You must define the point of attachment in the R line

  cd JointFuselageLeftWing/
  R = tmvector4r( 0.0500, 0.0000, 0.2610, 1 )


Define the forces and dampers on the following lines. 
Start with K-values of 10-100 (depending on aircraft size and weight), and D-values of 0.1-1. 
Test in afpro whether your parts are correctly attached or fall apart. Then increase values.

example of fuselage-wing-joint from bleriot slowflyer:
  Kf = 400
  Df = 1
  Ktx = 12
  Dtx = 0.15
  Kty = 12
  Dty = 0.15
  Ktz = 12
  Dtz = 0.15
  MaxForce = 10
  MaxTorque = 2.5
  Rigid = 0

example of fuselage-wing-joint from the spitfire:
  Kf = 80000
  Df = 100
  Ktx = 8000
  Dtx = 6
  Kty = 8000
  Dty = 6
  Ktz = 8000
  Dtz = 6
  MaxForce = 1500
  MaxTorque = 150
  Rigid = 0



Wings: 
Define the RootR values for the wing attachments
Define the RootN values to specify the direction (1 is left side, -1 is right side)

  cd Leftwing/
  Sections = 2
  RootR = tmvector4f( 0.1000, 0.2300, -0.0900, 1.0000 )
  RootN = tmvector4f( 0.0000, 1.0000, 0.0000, 0.0000 )

  cd Rightwing/
  Sections = 2
  RootR = tmvector4f( 0.1000, -0.2300, -0.0900, 1.0000 )
  RootN = tmvector4f( 0.0000, -1.0000, 0.0000, 0.0000 )




Rectractable gears:
Define the mounting value of the gear. If Retractable = 1 it can be retracted, otherwise Retractable = 0.
Define the retraction axis in RetractZ.
Define the retraction angle in RetractAngle.

  cd Rightgear/
  MountingR = tmvector4f( 0.1800, -0.6200, -0.1400, 1.0000 )
  MountingZ = tmvector4f( 1.0000, 0.0000, 0.0000, 0.0000 )
  Retractable = 1
  RetractZ = tmvector4f( 1.0000, 0.5000, 0.4000, 0.0000 )
  RetractAngle = -1.4




Weight of different objects can be easily changed:
Actual weight is displayed as well as minimum or maximum weight.
It can be edited by the user.

  Mass = 7
  RangeMassMax = 10
  RangeMassMin = 1.25




There exist different engines for different rc models.
Based on this the parameters differ in the tmd file.


Standard fuel engine:
  Append tmdengine00 Engine
  cd Engine/
  cd ../



Electric engine:
  Append tmdengine10 Engine
  cd Engine/
  cd ../



Jet engine:
  Append tmdturbine00 Turbine
  cd Turbine/
  cd ../




Smoke and Exhaust positions:

  cd Fuselage/
  SmokeR = tmvector4r( 0.3500, 0.0000, -0.0200, 1 )


  cd Engine/
  ExhaustR = tmvector4r( 0.2000, 0.0000, 0.0000, 1 )







D. Close to take off - Start afpro

Start afpro again, select your aircraft from the selection window.
If this all has be done correctly you may try to fly our aircraft.

 

Hope you enjoy it!
rodeo