--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/4CA1UHae2vQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
Hi
Patrick:
I am using the glTF model having texture images.I changed the texture use Cesium.Color,but it not Show that I specified color. It looks like the use of the ground texture. There is an error in my code? alse,Some material does not contain 'diffuse' value.http://xiangce.baidu.com/picture/detail/0b5f7c9bb03a8068bd20eb5c6200623b6937f370?from=dialog
----------------------------------------------------------------------------------
handler.setInputAction(function (movement) {
var primitive;
var pickedObject = viewer.scene.pick(movement.endPosition);
if (pickedObject) {
primitive = pickedObject.primitive;
if (pickedObject !== lastPick && primitive instanceof Cesium.Model) {
var entity = primitive.id;
var maters = allPrpos(pickedObject.primitive.gltf["materials"]);
if (primitive.olddiff == undefined) {
primitive.olddiff = [];
}
for (var i = 0; i < maters.length; i++) {
var material = primitive.getMaterial(pickedObject.primitive.gltf["materials"][maters[i]].name);
if (material.getValue('diffuse') == undefined) {
continue;
}
if (primitive.olddiff[i] == undefined) {
if (material.getValue('diffuse').clone == undefined) {
primitive.olddiff[i] = material.getValue('diffuse');
} else {
primitive.olddiff[i] = material.getValue('diffuse').clone();
};
}
material.setValue('diffuse', Cesium.Cartesian4.fromColor(Cesium.Color.RED));
}lastPick = pickedObject;
}
} else if (lastPick) {
primitive = lastPick.primitive;
var maters = allPrpos(primitive.gltf["materials"]);
for (var i = 0; i < maters.length; i++) {
var material = primitive.getMaterial(primitive.gltf["materials"][maters[i]].name);
if (material.getValue('diffuse') == undefined) {
continue;
}
material.setValue('diffuse', primitive.olddiff[i]);
}
lastPick = undefined;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
--