拉伸三个js纹理

时间:2019-02-14 11:30:34

标签: javascript three.js 3d textures texture-mapping

我正在使用THREE.OBJLoader将我的3D对象加载到Three.js r100中,并且在某个时刻,我需要使用THREE.TextureLoader()加载一些动态纹理。 然后,我只需使用THREE.MeshBasicMaterial()创建一个新材质并将其设置为我的obj。 这是代码:

//this contains the texture loaded
let texture = await new Promise((resolve, rejects) => loadGeneralTexture(resolve, rejects, url));

texture.minFilter = THREE.LinearFilter;
texture.needsUpdate = true;
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;

var material = new THREE.MeshBasicMaterial({
  map: texture
});

//this loop set the new material with Texture
el.traverse(child => {
  if (child instanceof THREE.Mesh) {
    child.material = material;
  }
});

The result is:

But the image loaded is:

我仅使用gizmo(3dMax工具)通过“旋转”纹理来解决此错误,但我不能使用Threejs进行相同的修复。

The same problem with two other 3d objects but this time it's even worse

编辑 obj文件是我们客户的文件(因此我自己没有创建它),我已经检查了各种“面孔”,它们是相等的。我可以使用threejs更改uvmapping吗?

0 个答案:

没有答案