问题
Is there any way to change the opacity/alpha of all hierarchy (branch) rather than per each mesh material?
回答1:
No. You can, however, use object.traverse()
to set the opacity of an object's material and it's children.
mesh.traverse( function( node ) {
if( node.material ) {
node.material.opacity = 0.5;
node.material.transparent = true;
}
});
three.js r.56
来源:https://stackoverflow.com/questions/15214543/three-js-change-the-opacity-of-an-entire-branch