我有一個衝浪板obj文件,我想在頂部和底部的表面上應用紋理,但當紋理在中間時會在我的面部應用時分裂。材料也被應用在網格的內部。問題與模型有關嗎?還是我錯過了代碼中的某些內容?Three.js紋理模型不能正確應用跨物體
var loader = new THREE.OBJLoader();
var texture = new THREE.Texture();
var ImageLoader = new THREE.ImageLoader();
ImageLoader.load("models/white.jpg", function (image) {
texture.image = image;
texture.needsUpdate = true;
});
var custom = new THREE.Texture();
var customLoader = new THREE.ImageLoader();
customLoader.load("models/UV_Grid_Sm.jpg", function(image) {
custom.image = image;
custom.mapping = THREE.UVMapping;
custom.needsUpdate = true;
});
loader.load("models/Hidden 5'4-19'5-2 (Holes_Patched).obj", function(object){
object.traverse(function(child) {
if (child instanceof THREE.Mesh) {
if(child.name === 'Bottom') {
child.material = new THREE.MeshStandardMaterial({ map: custom});
}
else if(child.name === 'Top') {
child.material = new THREE.MeshStandardMaterial({ map: custom});
}
else {
child.material = new THREE.MeshStandardMaterial({ map: texture});
}
}
});
download obj file here的對象都有一個名爲「頂級」二組,但後來我可以改變。
您的3D模型的紫外線是不會proper.Update紫外線使用任何3D軟件,如Blender – ArUn