Draw polygons problem

When drawing polygon,encounter a problem.

This are codes!

This the result!

If i change the height,as shown below,

the result was expected,

The test is on Sandcastle.

What’s wrong with me when i drawing the polygon?

You could use a wall instead of a polygon. Outlining using polylines for top and bottom could be an alternative if you don’t like the way wall outlines are drawn.

Scott


var entity = viewer.entities.add({
    name: 'polyline',
    wall: {
        positions: Cesium.Cartesian3.fromDegreesArrayHeights([
            116.749187, 40.369242, 70.0,
            116.751102, 40.369245, 70.0,
            116.751006, 40.368598, 70.0,
            116.750557, 40.368527, 70.0,
            116.750174, 40.368756, 70.0
        ]),
        minimumHeights: [30.0, 30.0, 30.0, 30.0, 30.0],
        fill: true,
        material: Cesium.Color.CYAN.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK
        },
});

viewer.zoomTo(viewer.entities);
1 Like

@scottUFR

Thank you very much for the suggestion! You are spot-on - @osbornyb please give this a try :rocket:

-Sam

Thank you very very much!
I have tried the wall,and it worked.But in the future,i want to realize hook face,like the picture below.
1635241972(1)
Maybe the hook face is not supported by the wall.

ModelGraphics might be the way to go unless you have the appetite for something more direct by implementing a custom primitive. The *Graphics classes correspond to GIS geometries rather than generic “graphics” geometries.

1 Like