简体   繁体   中英

Draw a triangle on a MapControl (UWP) 3d view

I need to draw a triangle on an Aerial3d view on a UWP MapControl to have some visual information for the user like to see if certain vector crosses mountains or tall buildings, ...

I have the origin Geopoint, the azimuth and the elevation from the horizontal plane. From this data, I can have also the final Geopoint and, I think, "the altitude" for the upper point of the triangle.

Azimuth and elevation can be changed anytime, so the triangle should be drawn as many times as needed.

MapPolygon, MapPolyline and such don't work in this case because lines should be drawn above and across the map and not stuck to it.

New MapControl MapElements such MapModel3D and MapElement3D are static objects so they don't work as well.

This is the idea:

在此处输入图片说明

You should be able to use a MapPolyline - it will correctly be drawn in 3D space if you specify an altitude reference system and have an altitude value set for each vertex. MapPolygon will always be drawn to the terrain. You should also be able to use a MapElement3D to show a filled polygon as shown on your picture. Just create a model that's a simple triangle and position at the origin/heading. If the origin or heading change, the model can be updated quickly. If the elevation angle changes, you'll need to re-create the model, but for a simple triangle, this should be reasonably fast. I've seen examples of someone animating a bird model with the wings flapping and getting 2-3FPS, so while it won't necessarily be interactively tracking, it should be a pretty quick update.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM