1
큐브의 각면에 다른 이미지를 적용하려고합니다.three.js에서 큐브 내부에 텍스처 적용
var material = [
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
}),
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
}),
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
}),
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
}),
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
}),
new THREE.MeshLambertMaterial({
map: THREE.ImageUtils.loadTexture('http://placehold.it/512x512', {}, function(){ webGLRenderer.render(scene, camera); })
})
];
var mesh = THREE.SceneUtils.createMultiMaterialObject(geom, new THREE.MeshFaceMaterial(material));
mesh.doubleSided = true;
을 그리고 그것은 작동하지 않습니다 http://codepen.io/anon/pen/mymOKe
나는이 같은 이미지를로드 :
나는 여기에 동작하는 예제가 있습니다. 코드에서 82 행부터 시작합니다. 107 행에는 텍스처 대신 색상으로 큐브를 작성하는 주석 처리 된 부분이 있으며 그 부분이 작동합니다.
은 내가 codepen를 업데이트하지만 질감은 여전히 – Carlo
내 대답을 업데이트 표시되지 않습니다. – gaitat
이 질문이나 답변으로 문제가 해결되면 체크 표시를 클릭하여 수락을 고려하십시오. 이는 해결책을 찾았으며 응답자와 자신에게 어느 정도의 평판을 제공한다는 것을 더 넓은 커뮤니티에 나타냅니다. 이를 수행 할 의무는 없습니다. – gaitat