Hi Cesium Development Team,
My question consists of two parts. First, is there any way to adjust/minimize shadows in glTF datasets loaded in Cesium. Below is a screenshot of a sample glTF file loaded in Cesium.
Second, I’m currently experimenting with the EntityModelColor.js for highlighting a 3D model. The results of highlighting a model are depicted in the image below.
Related to this, is it possible to select individual features rather than the entire model? (in my case that would be selecting individual buildings rather than the entire model).
Below is a snippet of my code that is used for performing the selection.
//Change color on mouse over. This relies on the fact that given a primitive,
//you can retrieve an associted en
var lastColor;
var lastPick;
var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function(movement) {
var primitive;
var pickedObject = viewer.scene.pick(movement.endPosition);
if (pickedObject) {
primitive = pickedObject.primitive;
if (pickedObject !== lastPick && primitive instanceof Cesium.Model) {
//We don’t use the entity here, but if you need to color based on
//some entity property, you can get to that data it here.
var entity = primitive.id;
var material = primitive.getMaterial(‘Material_0’);
//var material = primitive.getMaterial(‘Red’); - original line
lastColor = material.getValue(‘diffuse’).clone();
//material.setValue(‘diffuse’, Cesium.Cartesian4.fromColor(Cesium.Color.BLUE));
// idea from Philipp - add console log; set material to NULL value
console.log(material);
material.setValue(‘diffuse’, Cesium.Cartesian4.fromColor(Cesium.Color.YELLOW));
lastPick = pickedObject;
}
} else if (lastPick) {
primitive = lastPick.primitive;
var material = primitive.getMaterial(‘Material_0’);
//var material = primitive.getMaterial(‘Red’); - original line
material.setValue(‘diffuse’, lastColor);
lastPick = undefined;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
``
Regards
Kabiro