First, you'll need your 3D model to be in one of the file formats supported by VTP/OSG (.3ds, .obj, .lwo, .osg, .ive, ...). If you are using Blender, see How to use Blender with OSG/VTP. Nearly all 3D software can eventually produce a good realtime model. For example, from Google SketchUp, you can either export a .obj or .3ds directly, or you can export the model to Blender, clean up the model, then export to .osg.
There are many ways then then add the model to your scene:
In Enviro, first open the Layers dialog to see which structure layer is active. The instances you create will be added to the active layer (shown in bold). If you like, you can create a new layer and make it active.
Next, the menu command "Tools: Instance" will open the Structure Instances dialog. Choose the content item or file you want. Then, click the mouse on the terrain to add instances of that model.
You can save your changes with the Layer Dialog, by highlighting your layer and pressing "Save".
Load or create a structure layer. The menu command "Structures: Instances" (or the corresponding toolbar button) will open the Structure Instances dialog. Choose the content item or file you want. Then, click the mouse in the view to add instances of that model. Each time you click a new instance will be created.
You can save your changes by simply saving the layer with "Layer: Save Layer".
To view your instances in 3D with Enviro, do the following.
- Create a Shapefile which contains a Point at the location of each model. The Shapefile attributes (DBF) should contain the following fields:
filename
: may be either the full filename of the model, ex:C:/MyModels/House.3ds
, or any relative filename which will be found on your data path.scale
(optional): provide a value to scale the model, ex:100.0
rotation
(optional): provide a value (in degrees) to rotate the model, ex:65.0
- Run VTBuilder
- Command "Layer: Import Data", select "Structure"
- Indicate your Shapefile
- Indicate your projection
- Indicate "Instances (external models)". The file will then import, and the locations are drawn as small crosshairs. You can check your data now, to make sure it lines up with your other layers, or make small changes as necessary, such as converting the projection or offsetting the layer. Confirm that the projection of your data is the same as the other layers you will be using.
- Command "Layer: Save", save to a VTST file
- Move or copy your VTST file to your data path, in the folder Data/BuildingData
- Run Enviro
- In your "Terrain Creation Parameters", under the "Culture" tab, add your VTST file to the list of Structure Files.
- Launch your terrain scene. The models should be planted on the ground at the correct locations, such that their local origin is placed at ground level.
VTST is a simple XML text format, so you might want to simply create it yourself. See the documentation for the VTST Format, or simply copy one of the example files and fill in your own instances.