我将我的blender模型导出到OBJ并将其加载到Three.js。
我在搅拌机中重新导入OBJ,它似乎正确显示,所以它似乎是Three.js中的一个问题。
Image in blender showing the normals of the wheels are correct, and the track appears correctly.
Codepen of the Three.js code, and OBJ model is here
var material = new THREE.MeshLambertMaterial({ color: 0xcc8729 });
//Loader for the model
var loader = new THREE.OBJLoader();
var geometry = loader.parse(getObjFileAsString());
geometry.position.set(0, 0, 0);
geometry.castShadow = true;
geometry.receiveShadow = true;
geometry.traverse(child => {
if (child instanceof THREE.Mesh) {
child.material = material;
}
});
scene.add(geometry);
我是否需要改造车轮和轨道?或者有没有办法在Three.js中修复它?