简体   繁体   中英

Threejs not appying the texture to cube

I am struggling with texture..
see http://jsfiddle.net/henros/e6zs9mcj/3/
Can someone tell me why the color for the cube is not added..
See line 105 - 109

        var geometry2 = new THREE.BoxGeometry(50,50,50);
        var material2 = new THREE.MeshBasicMaterial({color: 0x000000});
        var cube2 = new THREE.Mesh(geometry2, material2);
        cube2.position.set(-300,0,25)
        scene.add(cube2);

The code defines a fog that seems to interact with the geometry. Disabling the fog or setting the I-don't-care-about-fog flag resolves the issue.

    var material2 = new THREE.MeshBasicMaterial({color: 0x000000, fog: false});

Check your scene setup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM