private void DrawModel() { ModelMarkerSymbol mms = new ModelMarkerSymbol(); mms.SourceUri = "Data/M-14/M-14.obj"; mms.Scale = 1000; SimpleRenderer sr = new SimpleRenderer(); sr.Symbol = mms; GraphicsOverlay graphicsOverlay = new GraphicsOverlay() { RenderingMode = GraphicsRenderingMode.Dynamic, Renderer = sr, SceneProperties = new LayerSceneProperties() { SurfacePlacement = SurfacePlacement.Relative } }; MapPoint mp = new MapPoint(-122.4167, 37.7833, 55000); Graphic gm = new Graphic(mp); graphicsOverlay.Graphics.Add(gm); this.sceneView.GraphicsOverlays.Add(graphicsOverlay); }
private async Task AddModelMarkerSymbol() { // Instantiate a new ModelMarkerSymbol ModelMarkerSymbol modelMarkerSymbol = new ModelMarkerSymbol(); // Set the SourceUri property modelMarkerSymbol.SourceUri = Path.Combine(AssemblyDirectory, @"Samples\Scene\PT-Boat-Model\PTBoat.obj"); // Increase the scale to achieve the desired visual size modelMarkerSymbol.Scale = 50; // Create a new MapPoint for the location MapPoint mapPoint = new MapPoint(-155, 19, -100); // Create a new Graphic to display the model symbol Graphic graphic = new Graphic(mapPoint); // Set the Graphic Symbol property graphic.Symbol = modelMarkerSymbol; // Create a GraphicsOverlay to contain the symbolized Graphic GraphicsOverlay graphicsoverlay = new GraphicsOverlay() { RenderingMode = GraphicsRenderingMode.Dynamic, SceneProperties = new LayerSceneProperties() { SurfacePlacement = SurfacePlacement.Relative } }; // Add the Graphic to the GraphicsOverlay graphicsoverlay.Graphics.Add(graphic); // Add the GraphicsOverlay to the MapView's GraphicsOverlays collection MySceneView.GraphicsOverlays.Add(graphicsoverlay); // Set the Viewpoint await MySceneView.SetViewAsync(new Camera(mapPoint.Y - 0.5, mapPoint.X + 0.5, 25000, 315, 70)); }
private async Task AddModelMarkerSymbol() { // Instantiate a new ModelMarkerSymbol ModelMarkerSymbol modelMarkerSymbol = new ModelMarkerSymbol(); // Set the SourceUri property modelMarkerSymbol.SourceUri = Path.Combine(AssemblyDirectory, @"Samples\Scene\PT-Boat-Model\PTBoat.obj"); // Increase the scale to achieve the desired visual size modelMarkerSymbol.Scale = 50; // Create a new MapPoint for the location MapPoint mapPoint = new MapPoint(-155, 19, -100); // Create a new Graphic to display the model symbol Graphic graphic = new Graphic(mapPoint); // Set the Graphic Symbol property graphic.Symbol = modelMarkerSymbol; // Create a GraphicsOverlay to contain the symbolized Graphic GraphicsOverlay graphicsoverlay = new GraphicsOverlay() { RenderingMode = GraphicsRenderingMode.Dynamic, SceneProperties = new LayerSceneProperties() { SurfacePlacement = SurfacePlacement.Relative } }; // Add the Graphic to the GraphicsOverlay graphicsoverlay.Graphics.Add(graphic); // Add the GraphicsOverlay to the MapView's GraphicsOverlays collection MySceneView.GraphicsOverlays.Add(graphicsoverlay); // Set the Viewpoint await MySceneView.SetViewAsync(new Camera(mapPoint.Y - 0.5, mapPoint.X + 0.5, 25000, 315, 70)); }
private void DrawModel() { ModelMarkerSymbol mms = new ModelMarkerSymbol(); mms.SourceUri = "Data/M-14/M-14.obj"; mms.Scale = 1000; SimpleRenderer sr = new SimpleRenderer(); sr.Symbol = mms; GraphicsOverlay graphicsOverlay = new GraphicsOverlay() { RenderingMode = GraphicsRenderingMode.Dynamic, Renderer = sr, SceneProperties = new LayerSceneProperties() { SurfacePlacement = SurfacePlacement.Relative } }; MapPoint mp = new MapPoint(-122.4167, 37.7833, 55000); Graphic gm = new Graphic(mp); graphicsOverlay.Graphics.Add(gm); this.sceneView.GraphicsOverlays.Add(graphicsOverlay); }