The DTED format works in the same way as any other raster format supported as an elevation source. You define them as RasterElevationSource objects and add them to the Scene's BaseSurface ElevationSources collection. You should be able to do something like:
string parentFolder = @"C:\Data\DTED0";
List<string> files = Directory.EnumerateFiles(parentFolder, "*.dt0", SearchOption.AllDirectories).ToList();
Scene.BaseSurface = new Surface();
RasterElevationSource rasterElevationSource = new RasterElevationSource(files);
Mike: I am trying to do this as well (get elevation values from a DTED1 surface) and have the following code (which is pretty similar to what you show above. (In this code dted1Files is an enumeration of DTED1 tiles and args.Location is a MapPoint - obtained via mouse click on a 2D map, not a scene.)
RasterElevationSource dted1ElevSource = new RasterElevationSource(dted1Files);
dted1ElevSource.Name = "DTED1";
Surface elevSurface = new Surface();
elevSurface.Name = "DTED1 Surface";
Scene dtedScene = new Scene();
dtedScene.BaseSurface = elevSurface;
double anElevation = await elevSurface.GetElevationAsync(args.Location);
However, I get a null exception error on the last line (elevSurface.GetElevationAsync). The message on the error states that 'Elevation must be in a scene view before getting elevation'.Any thoughts on what I'm missing? Any insights are much appreciated. Thanks!
This is a reply to myself (and also for the consumption of anyone else who might be trying to do the above). I added the following right before the last line of code in my post above:
SceneView aSceneView = new SceneView();
aSceneView.Scene = dtedScene;
...and was successful in getting an elevation value from the surface! The only thing I'm still trying to sort out is a possible projection issue. The spatial reference of the scene is WKID 4326 (WGS-84), but the spatial reference of the MapPoint that I'm passing into the GetElevationAsync method is WKID 3857 (Web Mercator Aux Sphere). So ... I'm getting a valid elevation, but am not sure if its for the correct spot in the scene. Does anyone know if Scene/SceneView does on-the-fly projection if the input MapPoint is in a different projection?
> I get the same elevation value whether I re-project the input MapPoint or not.
That proves the input mappoint is automatically projected to the SR it needs (ie so that it does indeed understand that the two point locations represents the same physical location).