Is it possible to draw custom objects(like smoke) on top of ArcGIS earth environment?

758
3
04-27-2020 07:56 AM
ShreeP
by
New Contributor II

My question is in continuation with the following query on Github.

Is it possible to draw custom objects(like smoke) using custom OpenGL 3.0 shader? · Issue #1050 · Es... 

Can someone please provide more details about an option where it is suggested to draw polygon graphics in a GraphicsOverlay?
Ex. How do we handle pixel colors?

Please provide the exact API name(or reference) for the same?


And it would be really great if I get a link to an example for reference?

Any help would be appreciated!

0 Kudos
3 Replies
LucasDanzinger
Esri Frequent Contributor

We don't have a way to draw custom OpenGL. You might be able to achieve something that can suffice for the time being. Here are some ideas:

- Display Graphics. Graphics will be for vector shapes only, so you could define polygons as a Graphic object (inside a GraphicsOverlay) and display various symbol fills with SimpleFillSymbol, PictureFillSymbol, or HatchFillSymbolLayer.

- Another option could be to create a Raster file with various cell values and then apply one of our RasterRenderers to the RasterLayer - RasterRenderer Class | ArcGIS for Developers 

- Another option would be to attempt to create and style your map in ArcGIS Online or ArcGIS Pro first. You can save as a Web Map (and consume with the Map c'tor that takes a URL) or as a MobileMapPackage. Both of these authoring tools (Pro and Online) have advanced styling options and have more things you can do than what we have exposed as developer APIs. However, our API will render what is defined. For example, you can define a HeatMapRenderer or display color ramps in ArcGIS Online and view them in Runtime, but we don't have ways to create either programmatically in Runtime at the moment.

- Finally, you could use our MapView::locationToScreen (https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html#locationTo... ) API to convert the real world coordinates of where you want your smoke layer to draw into screen coordinates. Then, you can display your custom OpenGL layer within those screen coordinates. I think this might be your best option. 

Let us know if any of these seem like options.

ShreeP
by
New Contributor II

Okay. Thanks Lucas!

Could you please provide more details about an option where you have suggested to use MapView::locationToScreen API?
Let's say we have a polygon in 3D(where I want to draw the smoke) and I retrieved the screen coords corresponding to the polygon vertices using the mentioned API.
Now, does it handle automatically the area where I need to draw the smoke (the screen polygon area)? And how can I fill those pixel colors with our custom smoke calculation?

Is there any example/sample available for drawing the custom OpenGL layer?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Here is the API ref for MapView::locationToScreen - MapView Class | ArcGIS for Developers 

If you are wanting this in 3D, I don't think my suggestion would be suitable  as you would need the polygon to properly wrap the globe. 

My suggestion was for 2D, and by "custom OpenGL layer", I was referring to some effect you could draw on the screen on your own.

Here is the visual hierarchy I imagined (this is just an idea - nothing I have tried on my own):

> ApplicationWindow

    > "custom OpenGL layer" - this is something you'd develop. We don't have any examples. This would be using Qt's graphic's stack to draw your smoke effects - Graphics | Qt 5.14 

    > MapView

        > Basemap

        > use locationToScreen to get coordinates back and update the screen geometry of your "custom OpenGL layer"

0 Kudos