Applying color to a model

Hello all,

I am trying to colorize a model added to scene with no success.
This is the code i'm using:

var model = scene.primitives.add(
  new Cesium.Model({
    gltf : gltf_model,
    modelMatrix : matrix,
    color: Cesium.Color.BLUE
  })
);

Thank you

Hello,

This example works for me:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var scene = viewer.scene;
var model;

var hpr = new Cesium.HeadingPitchRoll(0, 0, 0);
var origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0);
var modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(origin, hpr);

model = scene.primitives.add(Cesium.Model.fromGltf({
url : ‘…/…/SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb’,
modelMatrix : modelMatrix,
minimumPixelSize : 128,
color: Cesium.Color.RED
}));

``

Make sure you’re using the latest version of Cesium. Model coloring was added fairly recently. You can get the latest download here: http://cesiumjs.org/downloads.html

Best,

Hannah