我試圖將紋理應用於飛機。我正在使用和圖像是256x256。目前它只呈現黑色。有人能告訴我我要去哪裏嗎?Threejs - 將紋理應用於飛機總是呈現黑色,
//create the floor
var floorTexture = new THREE.ImageUtils.loadTexture('carpet.jpg'); //256x256
floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;
floorTexture.repeat.set(10, 10);
var floorMaterial = new THREE.MeshBasicMaterial({ map: floorTexture, side: THREE.DoubleSide });
var floorGeometry = new THREE.PlaneGeometry(1000, 1000, 10, 10);
var floor = new THREE.Mesh(floorGeometry, floorMaterial);
floor.position.y = -0.5;
floor.rotation.x = Math.PI/2;
scene.add(floor);
如果需要,我可以添加更多我的代碼。
謝謝!