我將我的攪拌機模型導出到OBJ並將其加載到Three.js。攪拌機出口到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中修復它?
是你的車輪偶然負面的規模? 你能分享你的攪拌機文件嗎? –