However, When I use Primitive for highlighting using Geometry Instance. Like below. It works fine, but then when I wanted to change its color using LEFT_CLICK event, I can't access the primitive. It doesn't come up in PrimitiveCollection or Cesium.Primitive. Not sure how to access.
1. Is there any sample which use Viewer Entities for highlighting top of 3D tileset.
2. How to alter Attributes with Primitive in such cases.
scene.primitives.add(new Cesium.ClassificationPrimitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.PolygonGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray(topTreeCoords))
),
height : 10,
extrudedHeight : 7
}),
attributes : {
color : customColor,//Cesium.Color.RED,
show : new Cesium.ShowGeometryInstanceAttribute(true)
},
id : "OuterID"
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILE
}));
This thread tells to use ReadyPromise.
https://groups.google.com/d/msg/cesium-dev/w8FlAxM6kw0/GiTOxHGzBAAJ