You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PolygonGeometry assumes the points with perPositionHeight are on the top, so when the extrudedHeight is greater than the position heights, the shape is inside out.
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var positions = Cesium.Cartesian3.fromDegreesArrayHeights([
-108.0, 25.0, 100000,
-100.0, 25.0, 100000,
-100.0, 30.0, 100000,
-108.0, 30.0, 300000
]);
var orangePolygonInstance = new Cesium.GeometryInstance({
geometry : Cesium.PolygonGeometry.fromPositions({
positions : positions,
extrudedHeight: 400000,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
perPositionHeight : true
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.ORANGE)
}
});
scene.primitives.add(new Cesium.Primitive({
geometryInstances : orangePolygonInstance,
appearance : new Cesium.PerInstanceColorAppearance({
closed : true,
translucent : false
})
}));
PolygonGeometry
assumes the points withperPositionHeight
are on the top, so when theextrudedHeight
is greater than the position heights, the shape is inside out.Found in #2923
Bonus: it might be neat to be able to specify a top and bottom height per position.
The text was updated successfully, but these errors were encountered: