New models for Aerofly Professional
Workshop from „Rodeo“
v1: 26.05.2002
Setup:
At first we need a new subfolder in the “aircraft folder of Aerofly.
It is recommended to take the same name for the folder and the files.
Avoid problematic characters like “space” or mutated vowels.
Copy the .tmg and .tmd files from a similar model to your new folder and rename them accordingly.
This should be the final structure:
aircraft
newmodel
newmodel.bmp
newmodel.obj
newmodel.tmg
newmodel.tmd
thumb.bmp
optional: soundnewmodel.wav
A: Graphical Construction:
For a new model we need a 3D- lattice model. Because of the following reason I would recommend to use Metasequoia LE:
-It is Freeware
-It is easy to use
-It contains many functions that we need
-It is a “slim” program without any ballast (Animations etc.)
-A converter from Metasequoia LE to Easyfly/Piccofly and Aerofly is available.
Metasequoia can be downloaded here:
http://www1.sphere.ne.jp/mizno/main_e.html
Stick to this rules when creating a 3D model:
- For each part of the model an own object must be defined.
- If you create additional graphics for weapons, tanks etc., there should also
be an object for each. In the .tmg file they will be handled as sub-objects.
- Each object can contain only 1 bitmap. Avoid to use more than one bitmap or
colour at a single object. Other wise it will be divided in separate objects later,
this is very confusing.
- All movable parts must be defined a single objects (ailerons, rudders, landing gears etc.)
- All movable parts must consist of closed polygons. If you cut out an aileron you must place a plain
at the open side (Face, Triangle). This is mandatory for Aerofly Pro., because the plain is used to
calculate the axis of rotation for the aileron.
- If your model needs a propeller just create the single blades with a pitch of 20 degrees. Keep an
eye on the correct direction of rotation (clockwise).
- Open the .tmg file to get an idea about the naming of objects.
- An object with the name “Fuselage” is mandatory.
Use any drawing program to create the bitmaps; the easiest one is MS Paint.
I can recommend “Pixia” that is not bad and, like Metasequoia LE, it’s free.
http://www.tacmi.co.jp/pixia/
Create your bitmap as a square with 24 bit color-depth and 256x256 or 512x512 px.
Refer to the Metasequoia workshop to find out how a bitmap is transferred onto your 3D model.
You can use Meta also for creating the preview picture in afpro. Just make a snapshot of your colored model in Meta.
In addition you can add a background picture in Meta to change the colors. The axis and gridlines can also be switched of to get a perfect view of the model.
Copy your snapshot into your paint program, cut the frames and resize your picture to 64x64 px. Save it as “thumb.bmp” in you model directory.
The conversion from Metasequoia LE to an afpro .obj file is done by a program that can be requested from IPACS by email.
B. TMG – The graphics definitions:
This file defines all objects that are visible in afpro. A part of an .obj file that is not defined in the .tmg will not be displayed. The .tmg file uses a tree structure for the object definitions.
Like mentioned above it is recommended to use a copy of a similar model. If you have copied the file we can start to modify and test the data.
The tree structure I like to explain in 3 examples.
1. Definition of single main objects
Append tmgeometricobject LeftGear Main object
cd LeftGear/
Geometry( "aircraft/rF86/rF86.obj", "Leftgear" )
cd .../ Back to Basis
Append tmgeometricobject RightGear Main object
cd RightGear/
Geometry( "aircraft/rF86/rF86.obj", "Rightgear" )
cd .../ Back to Basis
Append tmgeometricobject FrontGear Main object
cd FrontGear/
Geometry( "aircraft/rF86/rF86.obj", "Frontgear" )
cd .../ Back to Basis
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 Basis
Append tmgeometricobject TailGear Main object
cd TailGear/
Geometry( "aircraft/rJungmeister/rJungmeister.obj", "Tailgear" )
cd .../ Back to Basis
3. Definition of several 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 Basis
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 Basis
Stick to this rules:
- All objects from an .obj file that should be displayed in afpro must be defined.
- The tree structure must be correct, other wise the program will crash.
- The command cd.../ lead back to the basis. Therefore there might be more than one of this
commands be necessary at the end of the file, depending on the number of sub-objects.
- Attention: Object names can be different to the name in the .obj file.
- To avoid confusion the names should be the same.
- The object names in the .tmg should not be changed to make sure they fit to the .tmd file. Use
these names also in the .obj file.
- Take care of capitalization
Tip: If the data in the obj, bmp and tmg files are correct, afpro will display the complete model after selection in the main screen. If any part is missing, the definitions are not correct.
C. TMD – The model data:
The TMD file contains several data parts.
At first there are the Joint definitions and the definition of all relevant objects.
These are graphical objects, adhesive joints, but also receiver and servos.
Then follow the joints and the data of all other objects.
It is recommended to copy the TMD from the same model than the TMG is take from. This makes sure that the two files fit together.
It is mandatory that the TMD file structure accords the TGD file structure.
Stick to the following rules:
- All objects that are defined in the TMG should also be in the TMD.
- Check the syntax of both files.
- All main objects must be connected by joints; otherwise parts will fall off from the model.
- All main objects must be listed in the definition of the TMD file.
- A part with a movable object must have a link to this object (wing to aileron etc.)
- A link to the according servo must be created.
- For a movable part a servo must be defined.
- An “engine” is mandatory, even if the object is not visible.
If all steps are done, you can load your model into afpro. Don’t start flying, but select the Edit function. There you can set the values for weight, performance and centre of gravity.
After this close afpro and open the TMD file again with an editor.
If the geometry of movable parts is correct, afpro calculates the rotation axis automatically.
For the next step we need to put in some coordinates. Open the OBJ file in parallel and look for the according object. There you can find the correct values.
Joints:
If rigid=1 the parts can not break apart. If the value is 0, we have to mention the adhesive strength.
cd JointFuselageEngine/
Rigid = 1
The value for the adhesive joint must be set in line R (apprx. the area of the wing plug-in mount.
cd JointFuselageLeftWing/
R = tmvector4r ( 0.0500, 0.0000, 0.2610, 1)
Define the force- and decay character in the following lines.
Start with K-Values of 10-100 (depending on size and weight of the model) and D-Values from 0.1-1.
Check in afpro if the parts stick together. If they fall apart, the values must be raised.
Example of joints for fuselage-wing in the 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 for the Joints fuselage-wing of 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 root of the wing RootR
Define the Value for RootN to set the direction (1= left, -1=right)
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 )
Retractable Landing Gear:
Define the mounting pint of the landing gear. If Retractable=1, retraction possible; Retractable=0,
no retraction possible.
RetractZ = rotation axis
Retract Angle= Angle of rotation
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
Change the weight of single objects:
The file contains data to the current weight of single parts and the minimum and maximum limits.
Mass = 7
RangeMassMax = 10
RangeMassMin = 1.25
Different engines for different models:
The following parameters in the TMD depend on this value.
Normal combustion engine:
Append tmdengine00 Engine
cd Engine/
cd ../
Electric enginge::
Append tmdengine10 Engine
cd Engine/
cd ../
Jet Turbine:
Append tmdturbine00 Turbine
cd Turbine/
cd ../
Values for exhaust and smoke:
cd Fuselage/
SmokeR = tmvector4r( 0.3500, 0.0000, -0.0200, 1 )
cd Engine/
ExhaustR = tmvector4r( 0.2000, 0.0000, 0.0000, 1 )
Ready for take off !!!
Start afpro and select your new model. If everything has worked up to here you can now enjoy your flight.
Have fun
Rodeo











