When I load two 3d tilesets, using
var tree = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.buildModuleUrl(’…/…/…/…/Source/20095v1/tileset.json’)}));
var city = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.buildModuleUrl(’…/…/…/…/Source/bigTiles/tileset.json’)}));
and set the style using
var treeStyle = new Cesium.Cesium3DTileStyle({
color : “color(‘green’)”,
show: true
});
tree.style = treeStyle;
var defaultStyle = new Cesium.Cesium3DTileStyle({
color : “color(‘red’)”,
show : true
});
city.style = defaultStyle;
The scene renders as normal at first, but when I move my mouse to hover over the trees, it will change color to red(the city’s color). Or if I move my mouse to hover over the building, it will turn into green. These two behaviours appear alternately. I have attached three photos to illustrate what i mean
Hi Eli, thank you for the reply! Due to the fact I am using local data for 3d tiles I am not able to put it into a sandcastle example. However I am just using the nyc workshop template with my own data. I am just wondering am I loading two tilesets and set their styles in the correct way? The pattern I found is whichever tileset I hover my mouse over first, the other tileset will be set to the same color. For example, if I hover my mouse over building first, trees will be set to red after I hover over them and vice versa.
I am using the exact same code in feature picking sandcastle Cesium Sandcastle when silhouette is not supported. And the mouse over event seems to be turned on automatically with 3d tile inspector on, I was just trying to override that behaviour by using the code from feature picking sandcastle but with no success