Terrain Overlays |
Insight3D® supports terrain data loaded from the local filesystem in PDTT format, using AGIProcessedTerrainOverlay, or loaded from STK Terrain Server over the network or internet, using StkTerrainServerTerrainOverlay.
The PDTT file format is optimized for rendering performance. You can create PDTT files from a wide array of terrain formats, such as DTED and DEM, using AGIProcessedTerrainWriter.
STK Terrain Server is a commercial AGI product which processes and serves terrain data from varied sources, producing a global unified data set in quantized-mesh format. AGI hosts a server for customer use which can be accessed over the internet. Alternatively, you can connect to your own STK Terrain Server if you are in an offline or disconnected environment, or to incorporate your own terrain data into a best-available data set for your needs.
Terrain is added to the central body using the Add method, as shown in the Overlay Management topic. The following example shows how to display the rectangular extent of an overlay without adding it to the central body:
CentralBody earth = CentralBodiesFacet.GetFromContext().Earth; TerrainOverlay terrainOverlay = new AGIProcessedTerrainOverlay(terrainUri); SurfaceTriangulatorResult triangles = SurfaceExtentTriangulator.Compute(earth, terrainOverlay.Extent); TriangleMeshPrimitive mesh = new TriangleMeshPrimitive(SetHint.Infrequent); mesh.Set(triangles); SceneManager.Primitives.Add(mesh);
An overlay is created and initialized but not added to the central body so it is not rendered. Instead, the overlay's Extent property is used to create a triangle mesh primitive that shows the rectangular extent of the overlay. See the Triangle Mesh Primitive topic for details on the primitive. At a later point, perhaps in response to the user picking the extent on the globe, the primitive can be removed and the overlay added.
SceneManager.Primitives.Add(mesh); Scene.CentralBodies.Earth.Terrain.Add(terrainOverlay);
This technique also applies to imagery overlays.
Terrain overlays support customizing altitude scale and altitude offset. As shown in the images below, AltitudeScale is a visual aid used to exaggerate terrain and AltitudeOffset is a visual aid used to uniformly raise the terrain off the globe.
These properties are set using the TerrainOverlay interface as shown below:
terrainOverlay.AltitudeScale = 2.0; terrainOverlay.AltitudeOffset = 3000.0;
Since terrain files can be extremely large, the entire file is not kept in memory. Instead, a small portion of the file is kept in a memory cache. As the camera moves around, parts of the file are paged from disk into the cache. By default, the cache is 64 megabytes, which is allocated up front. If you are using high resolution terrain or the terrain appears blurry, try increasing the cache to 128 megabytes, or larger, as shown below:
SceneManager.GlobeOverlaySettings.TerrainCacheSize = 128;