Large scale terrain details generation

I have following problem.
I need to render thousands of small strategic map cities.

  • Each city is very similar to each and is composed of up to 100 different meshes
  • Cities are placed in different areas of the world i want to give them different rotation and position
  • Each mesh belonging to should nicely fit to the terrain (it means it has to have y-coordinate determined individually)

So far my approach is to group the meshes according to type and assemble each city by mesh category using instances, this way each building element can be given proper height over heightmap.

The problem i have is:

  • its kinda tedious to operate on such cities since they are composed of many instances of different meshes
  1. What approach do you suggest?
  2. Can i group together instances of different meshes and set their parent to some other mesh/node?

(attaching screenie, “cities” in red)

Yes! Use a TransformNode and either instance.parent = tnode, or
instance.setParent(tnode)

The difference is whether instance 1) transformation is already in tnode local coordinates or 2) is transformed to local coordinates. In case 1, instance will move in world space when parented. In case 2, instance will stay in the same world space.