looking at the json file of a 3d model i saw this line
"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]]
there are numbers less than 0 and greater than 1. I thought uv measurements should not be less than 0 or bigger than 1. Where is the error? They should be converted?
the geometry json data is this
{
"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"
}
how can i get exact points?
there are numbers less than 0 and greater than 1. I thought uv measurements should not be less than 0 or bigger than 1.
That is not the whole truth. UV-coordinates can be arbitrary numbers, in the end its up to the shaders to interpret them appropriately. In three.js there are parameters texture.repeat
, texture.offset
, texture.center
and texture.rotation
(see https://threejs.org/docs/#api/textures/Texture) that will be used to convert the values from the uv attribute to the values used for texture-lookups. By default, the values are used as they are.
What finally happens for values <0 and >1 depends on the settings for wrapS and wrapT (also documented in https://threejs.org/docs/#api/textures/Texture). For instance out of range values are used for texture-tiling if wrapS/T are one of the reaeat-types.
Where is the error? They should be converted?
So there may not even be an error in this case. The numbers could just indicate an intended tiling. But to change it you need to go to where the model came from.