【发布时间】:2018-12-03 20:35:20
【问题描述】:
我有一个级别列表,点击每个级别都会显示房间。我想更改每个房间对象的颜色。我尝试过使用以下代码 sn-p:
var selSet1 = NOP_VIEWER.getSelection();
NOP_VIEWER.clearSelection();
var color = new THREE.Color( 255 / 255, 0, 0, 1 );
for( let i = 0; i < selSet1.length; i++ ) {
NOP_VIEWER.setThemingColor( selSet1[i], color );
}
Autodesk.Viewing.Viewer3D.prototype.setColorMaterial = function(objectIds, color){
if( !(color instanceof THREE.Color) ) throw 'Invalid argument: Color';
var material = new THREE.MeshPhongMaterial
({
color: color,
opacity: 0.8,
transparent: true
});
NOP_VIEWER.impl.matman().addMaterial( 'ColorMaterial-' + new Date().getTime(), material, true );
};
两者都不工作,你能帮我解决这个问题吗?
【问题讨论】:
标签: autodesk-viewer