Skip to content Skip to sidebar Skip to footer

Threejs Texture Issue While Adding Hole Into The Shape

I have created shape using ExtrudeGeometry with different top and bottom texture. It is rendering correctly without holes into the shape. If I add holes into the shape, the bottom

Solution 1:

Thanks to Matey. As he suggested in comment just changing normal.z < -0.9 solves the issue and why is that he has already mentioned.

Working code:

for ( var face in mesh.geometry.faces ) {
    if (mesh.geometry.faces[ face ].normal.< -0.9) {                   
        mesh.geometry.faces[ face ].materialIndex = 5;
    }
}

Post a Comment for "Threejs Texture Issue While Adding Hole Into The Shape"