highlighting / changing color b3dm files

Hello,

Can I programmatically change the color of b3dm files that I have created 3dtiles?

3d Max model is created and the parts I want to color are divided into layers. This model is exported as an object then converted the object to 3dtiles. When looking at the result b3dm file, I see the layers I want to color.

This may be the wrong way to follow. I hope you understand my purpose. Coloring according to the layers of model made in 3DMax.

...name":["Barrel.013","Barrel.012","Barrel.011","Barrel.010","Barrel.009","Barrel.008","Barrel.007","Barrel.006...

... {"name":"Barrel.010_Cylinder.012-Mesh_batchId","componentType":5123,"...

You can find sample files in the link.

https://wetransfer.com/downloads/f083bc16c9d6674361a56b47a66e58f920171222072248/bfcdaa

Since the b3dm already has the _BATCHID attribute you can use the styling language to set the colors.

For example:

tileset.style = new Cesium.Cesium3DTileStyle({

color: {

conditions: [

["${name} === ‘Barrel.013’", “rgb(45, 0, 75)”],

["${name} === ‘Barrel.012’", “rgb(102, 87, 12)”],

["${name} === ‘Barrel.011’", “rgb(50, 50, 151)”],

["${name} === ‘Barrel.010’", “rgb(200, 255, 50)”],

["${name} === ‘Barrel.009’", “rgb(30, 30, 55)”],

["${name} === ‘Barrel.008’", “rgb(102, 50, 151)”],

["${name} === ‘Barrel.007’", “rgb(0, 255, 255)”],

["${name} === ‘Barrel.006’", “rgb(255, 78, 30)”],

["${name} === ‘Barrel.005’", “rgb(10, 255, 10)”],

["${name} === ‘Barrel.004’", “rgb(60, 50, 50)”],

["${name} === ‘Barrel.003’", “rgb(54, 98, 2)”],

["${name} === ‘Barrel.002’", “rgb(150, 255, 7)”],

["${name} === ‘Barrel.001’", “rgb(56, 0, 255)”],

[“true”, “rgb(255, 255, 255)”]

]

}

});

colors.png

thank you.

24 Aralık 2017 Pazar 23:33:33 UTC+3 tarihinde legen...@gmail.com yazdı:

thank you.

so how can i destroy all the assigned styles, programmatically.

Assigning undefined to tileset.style will remove the styles.