Artifacts in the Geometry-and-Appearances tutorial

Hello everybody,

I’m trying to get the same picture as in the tutorial http://cesiumjs.org/tutorials/Geometry-and-Appearances. Just use this code (the last example from the section “Combining Geometries”) in the SandCastle:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var instances = ;

for (var lon = -180.0; lon < 180.0; lon += 5.0) {
for (var lat = -85.0; lat < 85.0; lat += 5.0) {
instances.push(new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(lon, lat, lon + 5.0, lat + 5.0)
}),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(
Cesium.Color.fromRandom({alpha : 0.5}))
}
}));
}
}
viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : instances,
appearance : new Cesium.PerInstanceColorAppearance(),
asynchronous: false
}));

I’m getting rectangles with a lot of artifacts over them. Cesium 1.31 on Windows 7, all browsers. Is this tutorial too old? Any workaround?

Thanks, Boris.

Update: it works properly after adding to the RectangleGeometry constructor:

vertexFormat: Cesium.VertexFormat.POSITION_AND_NORMAL

Thanks for catching this! We’ve put in a fix and the change should be reflected on the website soon.

  • Rachel