将.obj文件全部加载为黑色

时间:2014-11-07 01:52:44

标签: three.js

我已成功加载了一个使用Blender进行三角测量的3d模型。麻烦是全黑的,我无法弄清楚如何让它显示颜色或纹理。

我有一个像这样初始化的环境光:

function init(){     scene = new THREE.Scene;

camera = new THREE.PerspectiveCamera(
        75, (window.innerWidth) / (window.innerHeight),
        1, 10000);
camera.position.x = 500;
camera.position.z = 100;
camera.lookAt(new THREE.Vector3(0, 0, 0));
camera.rotateZ(90 * Math.PI / 180);

scene.add(new THREE.AmbientLight(0xffffff));

populate();

renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.render(scene, camera);
document.body.appendChild(renderer.domElement);
document.addEventListener('keydown', function(event) { keydown(event);
});

}

这是与.obj一起使用的.mtl Blender MTL文件:'mq9.blend' 材料数量:4

newmtl Material__69 Ns 9.803922 Ka 0.000000 0.000000 0.000000 Kd 0.225882 0.225882 0.225882 Ks 0.900000 0.900000 0.900000 Ni 1.000000 d 1.000000 illum 2

newmtl _6___Default Ns 19.607843 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.900000 0.900000 0.900000 Ni 1.000000 d 1.000000 illum 2

map_Kd missile.jpg

newmtl mq_9 Ns 31.372549 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.990000 0.990000 0.990000 Ni 1.000000 d 1.000000 illum 2

map_Kd predator.jpg

map_Bump predator_Normal.jpg

newmtl mq_90 Ns 31.372549 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.990000 0.990000 0.990000 Ni 1.000000 d 1.000000 illum 2

map_Kd predator.jpg

map_Bump predator_Normal.jpg

各种.jpgs都被找到但是由于某些原因它们似乎不是由three.js渲染的。我想知道是否需要以某种方式修改jpgs以反映三角测量?

截图: enter image description here

0 个答案:

没有答案