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!