Hi !
First of all, happy new year ! I hope cesium will continue this year, as great as years passed !
I’ve just updated Cesium to 1.29
I’m trying to color a list of 3D models.
I use the Entities with modelGraphics.
The issue i run into is that when i create multiple 3D Models, they will all take the last model color i create.
I want 1 red, 1 blue, 1 green.
In this order.
They are all green.
here’s the code in sandcastle:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var position = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 250000.0);
var heading = Cesium.Math.toRadians(135);
var pitch = 0;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var modelBlue = viewer.entities.add({
name : ‘…/…/SampleData/models/CesiumAir/Cesium_Air.glb’,
position : position,
orientation : orientation,
model : {
uri : ‘…/…/SampleData/models/CesiumAir/Cesium_Air.glb’,
minimumPixelSize : 128,
maximumScale : 20000,
color : Cesium.Color.BLUE,
colorBlendMode : Cesium.ColorBlendMode.MIX
}
});
var position2 = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 280000.0);
var heading2 = Cesium.Math.toRadians(135);
var pitch2 = 0;
var roll2 = 0;
var hpr2 = new Cesium.HeadingPitchRoll(heading2, pitch2, roll2);
var orientation2 = Cesium.Transforms.headingPitchRollQuaternion(position2, hpr2);
var modelRed = viewer.entities.add({
name : ‘…/…/SampleData/models/CesiumAir/Cesium_Air.glb’,
position : position2,
orientation : orientation2,
model : {
uri : ‘…/…/SampleData/models/CesiumGround/Cesium_Ground.glb’,
minimumPixelSize : 128,
maximumScale : 20000,
color : Cesium.Color.RED,
colorBlendMode : Cesium.ColorBlendMode.MIX
}
});
var position3 = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 260000.0);
var heading3 = Cesium.Math.toRadians(135);
var pitch3 = 0;
var roll3 = 0;
var hpr3 = new Cesium.HeadingPitchRoll(heading3, pitch3, roll3);
var orientation3 = Cesium.Transforms.headingPitchRollQuaternion(position3, hpr3);
var modelGreen = viewer.entities.add({
name : ‘…/…/SampleData/models/CesiumAir/Cesium_Air.glb’,
position : position3,
orientation : orientation3,
model : {
uri : ‘…/…/SampleData/models/CesiumGround/Cesium_Ground.glb’,
minimumPixelSize : 128,
maximumScale : 20000,
color : Cesium.Color.GREEN,
colorBlendMode : Cesium.ColorBlendMode.MIX
}
});
viewer.zoomTo(viewer.entities);
What can i do?
Is this really a bug ?
Thanks in advance.