// 修改颜色
overrideColorOnFragments(fragIds,color,objs,sceneName) {
var material = new THREE.MeshPhongMaterial( { color: "#"+color,emissive:"#"+color,transparent:true})
material.opacity=0.8;
for (var j=0; j<fragIds.length; j++) {
var mesh = viewer.impl.getRenderProxy(viewer.model, fragIds[j]);
var myProxy = new THREE.Mesh(mesh.geometry, material);
var box = new THREE.BoundingBoxHelper( myProxy ,0xffffff);
myProxy.matrix.copy(mesh.matrixWorld);
myProxy.matrixAutoUpdate = false;
myProxy.matrixWorldNeedsUpdate = true;
myProxy.frustumCulled = false;
myProxy.dbid = objs[0];
this.viewer.impl.addOverlay(sceneName, myProxy);
}
}
overrideColorOnObj(objs,color,sceneName) {
// initOverlays(color)
var _this = this;
this.viewer.getObjectTree(function(objTree) {
for (var i=0; i<objs.length; i++) {
var frags = [];
objTree.enumNodeFragments(objs[i], function(fragId) {
frags.push(fragId);
_this.overrideColorOnFragments(frags,color,objs,sceneName);
});
}
});
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。