function ChangeColor(){
var layer3Ds = scene.get_layer3Ds();
layer3D = layer3Ds.get_item(0);
selection3Ds = scene.findSelection3Ds(true);
if (selection3Ds.length === 0) {
alert("没有对象被选中。");
return;
}
if (selection3Ds !== null) {
var id = selection3Ds[0].get_item(0);
selection3Ds[0].removeAll();
var feature3D = layer3D.findFeature3DByID(id);
var regionRed = Number(document.getElementById("regionRed").value);
var regionGreen = Number(document.getElementById("regionGreen").value);
var regionBlue = Number(document.getElementById("regionBlue").value);
var style = new SuperMap.Web.Core.Style3D();
//style.set_lineWidth(10003);
style.set_fillForeColor(new SuperMap.Web.Core.Color(regionRed, regionGreen, regionBlue, 100));
feature3D.set_style3D(style);
} else {
alert("没有对象被选中。");
}
}
代码如上,选中一个对象后触发方法,对象的颜色没有改变。请问怎么能实现该方法? 谢谢