I’m guessing I’m missing something simple here. I’m trying to add a RectangleOutlineGeometry as a primitive and hitting a strange issue.
First, here’s the code I’m using, copied directly from here:
const rectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
id : 'rectangle',
attributes : {
color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
}
});
scene.primitives.add(new Cesium.Primitive({
geometryInstances : rectangleInstance,
appearance : new Cesium.PerInstanceColorAppearance()
}));
All I’m doing is changing RectangleGeometry
to RectangleOutlineGeometry
, which results in this error:
DeveloperError: Appearance/Geometry mismatch. The appearance requires vertex shader attribute input 'compressedAttributes', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.
Taking a look at this page, it looks like vertexFormat
isn’t part of the options for that class.
What am I missing?
Thanks!