I'm trying to draw a 3D polygon in the scene. But I didn't find the right way. Is there any way to achieve this? The function code is as follows:
function addPolygonGraphic() {
// create the polygon by assigning points
polygonBuilder.addPointXYZ(centerX, centerY, 10000);
polygonBuilder.addPointXYZ(centerX + 0.1, centerY, 10000);
polygonBuilder.addPointXYZ(centerX + 0.1, centerY, 10000);
polygonBuilder.addPointXYZ(centerX, centerY, 10000);
// assign the geometry of the graphic to be the polygon
polygonGraphic.geometry = polygonBuilder.geometry;
// add the graphic to the polygon graphics overlay
graphicsOverlay.graphics.append(polygonGraphic);
}
Thank you very much!
Solved! Go to Solution.
Couple of things to consider:
- does the graphics overlay have the surface placement mode set? Here's an example - https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/Scenes/Se... Since you've set z values, you probably want absolute. Here is the doc - https://developers.arcgis.com/qt/qml/api-reference/enums-surfaceplacement.html .
- Have you set the spatial reference of your polygon builder to match whatever the centerX and centerY variables are using?
Couple of things to consider:
- does the graphics overlay have the surface placement mode set? Here's an example - https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/Scenes/Se... Since you've set z values, you probably want absolute. Here is the doc - https://developers.arcgis.com/qt/qml/api-reference/enums-surfaceplacement.html .
- Have you set the spatial reference of your polygon builder to match whatever the centerX and centerY variables are using?
Thank you very much!