나는 초보자이며 뭔가 놓쳤다 고 생각합니다.
누군가 확인해 주시겠습니까?
HTML 페이지 : http://xalien95.altervista.org/pkmnxy_engine/alisopoli.html
모델과 텍스처 : http://xalien95.altervista.org/pkmnxy_engine/alisopoli/
내가 (이상한 색상) 모델을 볼 수 있지만 텍스처 (이것은 여러 재료 메시입니다).
미리 감사드립니다.JSONloader로 텍스처로드
편집 : 나는 모든 재료 유형과 노력 :
- THREE.MeshBasicMaterial
- THREE.MeshDepthMaterial
- THREE.MeshLambertMaterial
- THREE.MeshNormalMaterial
- THREE.MeshPhongMaterial
아무도 작동하지 않으므로 뭔가 놓친 것 같아서 (또는 재료 경로가 다릅니다.) 스크립트는 다음과 같습니다.
var camera, scene, renderer, mesh, loader;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 1, 10000);
camera.position.z = 1000;
scene = new THREE.Scene();
loader = new THREE.JSONLoader();
loader.load("./alisopoli/alisopoli.js", function(geometry, materials) {
var faceMaterial = new THREE.MeshPhongMaterial(materials);
mesh = new THREE.Mesh(geometry, faceMaterial);
mesh.scale.set(100, 100, 100);
mesh.position.y = -150;
mesh.position.x = 0;
mesh.rotation.x = 60;
scene.add(mesh);
});
var ambientLight = new THREE.AmbientLight(0x555555);
scene.add(ambientLight);
//var directionalLight = new THREE.DirectionalLight(0xffffff);
//directionalLight.position.set(1, 1, 1).normalize();
//scene.add(directionalLight);
renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
}
function animate() {
requestAnimationFrame(animate);
//mesh.rotation.y += 0.005;
renderer.render(scene, camera);
}
미리 감사드립니다.
var faceMaterial = new THREE.MeshFaceMaterial (materials); 또한 수출업자는 lightMap을 각 머티리얼에 적용합니다. 이들을 'null'로 설정하십시오. 여전히 문제가 발생하면 작업을 시작하기 전까지 간단한 프로젝트로 시작하십시오. 다른 사람들에게 도움이되는 질문을하십시오. – WestLangley
@WestLangley 감사합니다! 그것은 작동합니다! THREE.DoubleSide와 텍스처의 알파 채널에 문제가 있습니다. 'faceMaterial.side = THREE.DoubleSide; '를 추가하려고 시도했지만 작동하지 않습니다. 다시 고마워요 :) – xAlien95