1. A concise explanation of the problem you’re experiencing.
I try to change the default color of my material and I have an error :
It’s the first time I use Cesium, so I think the problem is in my code.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
You can find my code and the error here :
https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=fZLRa9swEMb/FeGXOmDktOleOjcspGUrpHRQaBnTHq72JRGVJXM6O2Qj/3vlJF6cZMz2g+6+7zt0P9wAiUbjCkncCosrMUWv61K+bHvxRb4tp84yaIt0MfisbBMy2noGm+Nx6iu6EpnWD3s1/qOs4vZd7BVx0/e/gjFdpvWKk6dyXrN21ofYPjIF4nACO5JzcuUdLgjRT4hg/Q31Ysk+/nk+6PoqEeG7HA6HyT/U0X/V60SMduqvQbfPZrBpUQQYW1DS52hRVqTLcOEGvYSiiHubfu+UcyQdrHbJDmvSmaCqEGhL+ojcIzCSBjP5qx8GKy736o3oNRXXVs8dlf6krTh3xtEBcVvJH/ez2dOrXGleTky1hHgoPw36sc2h2Ig+lx2YKIkyz2uD4x3SL7qsHLGoycRSpoxlZcI1ffpW5+/IMve+DWZpF8oK3Qhd3Kro5CdUkcgNeB+UeW3Ms/6NKhpnafAfxYyDQtvFU4NkYN1alpfj2a4ppczSUJ6n2DnzBtSb+AE
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I simply want to change color.
4. The Cesium version you’re using, your operating system and browser.
I use cesium in Angular so :
“angular-core”: “6.1.6”
“angular-cesium”: “0.0.53”
Have you an idea ?
Thanks !
omar
#3
I think you have the wrong syntax for your material creation. It should be:
viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : instance,
appearance : new Cesium.MaterialAppearance({
material: new Cesium.Material({
fabric : {
type : ‘Color’,
uniforms : {
color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
}
}
})
})
}));
``
Which I figured out from looking at this page in the docs:
https://cesiumjs.org/Cesium/Build/Documentation/Material.html
You might also find this guide helpful: https://cesium.com/docs/tutorials/geometry-and-appearances/