Children of an invisible parent are not visible.
There is a reasonable workaround, however: set the material visibility to false.
You will need to clone()
the material for each object, but that is OK, because the objects will (in the case of WebGLRenderer
) still share the same shader program.
var material = new THREE.MeshPhongMaterial();
parent = new THREE.Mesh( geometry, material.clone() );
parent.material.visible = false;
child = new THREE.Mesh( geometry, material.clone() );
EDIT: Updated answer based on OP suggestion (see comments) and recent pull request.
three.js r.68 (r.69dev for CanvasRenderer
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…