三个 json 模型 - uv 贴图问题

THREEJS json model - uv map issue

查看 3d 模型的 json 文件时我看到了这一行

 "uvs": [[-3.21834,-1.65399,-3.21834,-2.57657,4.21834,-2.57657,4.21834,-1.65399,4.21834,-1.85233,4.21834,-2.7749,-3.21834,-2.7749,-3.21834,-1.85233,4.21834,0.961286,-3.21834,0.961286,-3.21834,0.038714,4.21834,0.038714]]

有小于0和大于1的数字。我认为uv测量值不应该小于0或大于1。错误在哪里?他们应该被转换?

几何json数据是这个

{
    "type": "Geometry",
    "materials": [{
        "visible": true,
        "colorAmbient": [0.690196,0.690196,0.690196],
        "depthWrite": true,
        "DbgIndex": 0,
        "mapDiffuseAnisotropy": 1,
        "doubleSided": true,
        "blending": "NormalBlending",
        "wireframe": false,
        "depthTest": true,
        "specularCoef": 50,
        "mapDiffuse": "roof.png",
        "colorSpecular": [0.1,0.1,0.1],
        "opacity": 1,
        "shading": "phong",
        "colorDiffuse": [0.690196,0.690196,0.690196],
        "mapDiffuseRepeat": [1,1],
        "transparent": false,
        "DbgColor": 15658734,
        "mapDiffuseWrap": ["RepeatWrapping","RepeatWrapping"],
        "colorEmissive": [0,0,0],
        "DbgName": "roof_png_material"
    }],
    "data": {
        "skinIndices": [],
        "skinWeights": [],
        "name": "RoofGeometry",
        "normals": [0.64452,-0.593982,0.481368,0.494247,-0.563707,-0.661733,0.494247,0.563707,-0.661733,0.64452,0.593982,0.481368,-0.656606,0.597949,0.459639,-0.474654,0.561144,-0.67806,-0.474654,-0.561144,-0.67806,-0.656606,-0.597949,0.459639,-0.02356,0.642933,0.765526,-0.02356,-0.642933,0.765526,0.019044,-0.784814,-0.619373,0.019044,0.784814,-0.619373],
        "metadata": {
            "uvs": 1,
            "bones": 0,
            "materials": 1,
            "normals": 12,
            "generator": "io_three",
            "morphTargets": 0,
            "version": 3,
            "vertices": 12,
            "faces": 10
        },
        "morphTargets": [],
        "vertices": [3.43784,-3.71834,-0.861598,3.43784,3.71834,-0.861598,3.43784,-3.71834,-1.23063,3.43784,3.71834,-1.23063,-0.096621,3.71834,0.184514,-0.096621,-3.71834,0.184514,-0.096621,3.71834,-0.184514,-0.096621,-3.71834,-0.184514,-3.18641,3.71834,-0.940931,-3.18641,3.71834,-1.30996,-3.18641,-3.71834,-1.30996,-3.18641,-3.71834,-0.940931],
        "uvs": [[-3.21834,-1.65399,-3.21834,-2.57657,4.21834,-2.57657,4.21834,-1.65399,4.21834,-1.85233,4.21834,-2.7749,-3.21834,-2.7749,-3.21834,-1.85233,4.21834,0.961286,-3.21834,0.961286,-3.21834,0.038714,4.21834,0.038714]],
        "animations": [],
        "faces": [43,0,2,3,1,0,0,1,2,3,0,1,2,3,43,8,9,10,11,0,4,5,6,7,4,5,6,7,43,0,1,4,5,0,0,3,8,9,0,3,8,9,43,7,6,3,2,0,10,11,2,1,10,11,2,1,43,2,0,5,7,0,1,0,9,10,1,0,9,10,43,1,3,6,4,0,3,2,11,8,3,2,11,8,43,4,6,9,8,0,8,11,5,4,8,11,5,4,43,6,7,10,9,0,11,10,6,5,11,10,6,5,43,7,5,11,10,0,10,9,7,6,10,9,7,6,43,5,4,8,11,0,9,8,4,7,9,8,4,7],
        "bones": [],
        "influencesPerVertex": 2
    },
    "uuid": "2F93879C-96CB-3936-AEFC-CE9840D3057D"
}

我怎样才能得到准确的分数?

there are numbers less than 0 and greater than 1. I thought uv measurements should not be less than 0 or bigger than 1.

事实并非如此。 UV 坐标 可以 是任意数字,最终由着色器来适当地解释它们。 three.js 中有参数 texture.repeattexture.offsettexture.centertexture.rotation(参见 https://threejs.org/docs/#api/textures/Texture) uv 属性设置为用于纹理查找的值。默认情况下,值按原样使用。

值 <0 和 >1 的最终结果取决于 wrapS 和 wrapT 的设置(也记录在 https://threejs.org/docs/#api/textures/Texture 中)。例如,如果 wrapS/T 是其中一种反应类型,则超出范围的值将用于纹理平铺。

Where is the error? They should be converted?

所以在这种情况下甚至可能没有错误。这些数字可能只是表示预期的平铺。但是要更改它,您需要转到模型的来源。