Model Definitions

Users may add their own models to the set delivered with the application.

To do this:

  • From the AFSIM installation, add a directory install_dir/resources/site.

  • Inside of the site directory make a models.txt file.

  • Create references to your models in the models.txt file.

The models.txt file contains two types of entries:

  • alias : associate an additional name with a model definition

  • model : create a model definition

model

Models are defined in blocks as follows

model *model_name*
   filename *file*
   set *set*
   default_set
   pre_xform
      scale *s_value*
      translate *t_value*
      rotate *[x,y,z]* *r_value*
   end_pre_xform
   screen_scale *ss_value*
   wing_tip *wx_value* *wy_value* *wz_value*
   engine
      position *wx_value* *wy_value* *wz_value*
      diameter *d_value*
   end_engine
   billboard
   articulation *visual_part_name* *node_name*
end_model
  • The model definition will be named model_name, and models with this icon name will appear with this model in the application.

  • The model file is referenced with file. This file may be an ive, osgb, openflight, obj, or any model format natively supported by OpenSceneGraph. The file may also be an image file supported by OpenSceneGraph.

The remaining inputs are optional.

  • The set command will add the model to a set. If the model set is ‘immersive’ the model will be used in immersive views in lieu of the default model. If no set is given, a model will be added to the default model set.

  • The default_set command will add the model to a default_set. The default_set is used in the map-view and is used in an immersive view when there is no model of the given name in the ‘immersive’ set.

  • The pre_xform will apply the provided transforms to the model before it is displayed. In general, it is better to apply these transforms to your model geometry itself in modeling software than to use the pre_xform block. The pre_xform block may take as many of the three transforms as needed, in whatever order needed.

  • screen_scale’s ss_value will make the scaled icon of the model bigger or smaller. The application automatically scales the icon to attempt to create uniformity of all icons, the ss_value alters this behavior.

  • The wing_tip command allows the user to define the location of the wing-tip. The application assumes the other wing-tip is reflected on the y-axis.

  • The engine command allows the user to define the position and diameter of an engine’s exhaust outlet. Multiple engines may be defined.

  • billboard will make the model into a billboard, meaning that the model will always rotate towards the camera.

  • articulation allows the mapping of a simulation’s visual_part motion to a node on a 3d-model’s scene-graph. The models scene-graph may be viewed from the model viewer. Any node in the models graph is acceptable, but motion is applied to the node’s local coordinate frame, and if it is not properly transformed it may not move as anticipated.

Alias

Aliases are formatted as follows:

alias *alias_name* *model_name*

Where the alias_name is a new name the user may associate with the definition with model_name.