Difference between revisions of "Tile Models"

From Silent Wings Wiki
Jump to: navigation, search
 
Line 16: Line 16:
 
     coosys = surface
 
     coosys = surface
 
  }
 
  }
 
+
 
  model {
 
  model {
 
     id  = 2
 
     id  = 2
 
     file = windsock.gng
 
     file = windsock.gng
 
  }
 
  }
+
 
 
  model {
 
  model {
 
     id = 2
 
     id = 2
Line 32: Line 32:
 
     coosys = surface
 
     coosys = surface
 
  }
 
  }
 
+
 
  model {
 
  model {
 
     id = 2
 
     id = 2

Latest revision as of 13:39, 10 March 2014

A scenery can contain 3D models at specific georeferenced positions, such as buildings, bridges and other fixed structures.

These models reside in the "models" subfolder of each scenery block. This folder should contain all the models in .gng format with their texture files int he models/textures subfolder. In addition the folder should contain a set of index files. These index files should be named tmRRRCCC.dat where RRR and CCC are the row and column numbers of the scenery tile these models belong in.

The TM-file defines all models that are used in each tile, as well as the position and orientation of each instance of this model. For example:

model {
   id   = 1
   file = norrak2k_0065.gng
   lat  = 59.7595976461
   lon  = 9.91826831515
   alt  = 2.83452878869
   rx   = 0
   ry   = 0
   rz   = 0
   coosys = surface
}

model {
   id   = 2
   file = windsock.gng
}
  
model {
   id = 2
   lat  = 59.7597236675
   lon  = 9.91773279126
   alt  = 2.74537796015
   rx   = 0
   ry   = 0
   rz   = 0
   coosys = surface
}

model {
   id = 2
   lat  = 59.757
   lon  = 10.001
   alt  = 0.0
   rel_gnd = true
   rx   = 0
   ry   = 0
   rz   = 0
   coosys = surface
}

Here we have two models, a runway model called "norrak2k_0065.gng" and a windsock called "windsock.gng". The windsock is used twice with different positions. First we define the model with a unique integer id and a file name, next we reference it twice with the same ID and the actual positions/orientations of each instance.

Most of these parameters should be self-explanatory, but there are a couple of flags which can be useful to know about:

   coosys = surface

By default, the model is placed in geocentric coordinates, i.e. relative to a coordinate system centered in the earth's center where the X-axis points through the 0 meridian and equator, the z axis points up through the north pole, and the y axis points out somewhere in the indian ocean.

Usually, however, you want to place the object relative to the earth's local surface around your object. To achieve this, add the above parameter.


   rel_gnd = true

By default, the alt parameter is relative to ocean level. By adding this flag, the altitude is taken to be relative to the terrain surface in the location of the object.