I’m not super familiar with the Geometry
class, i thought it was removed. But yes, UV data can be decimal data (of any precision).
Is there any chance you could tackle your problem with BufferGeometry
?
Perhaps doing another snippet:
const myPositions = /*tell us the length, the format*/
const myFaces = /*tell us the length, the format*/
const myUvs = /*tell us the length, the format*/
/*... any other DATA ...*/
const geom = new BufferGeometry()
/* what do i do here */
If I loop through the array and assign UVs in groups of three Vector2s, the UV is severely incorrect with textures appearing warped.
This might be due to new THREE.Vector2(uvp[1], uvp[2]))
Try new THREE.Vector2(uvp[0], uvp[1]))
I don’t understand how you’re getting an undefined first index. Again, if you are using max script, i think this is not as trivial as you might imagine it, and the whole “two meshes” concept comes to play. If you just got some data, post it here so it can be understood.
If you don’t know what to ask, i suggest making a simple quad (two triangles) with BufferGeometry
to get a better grasp on what’s going on.
First start with a triangle and triangle soup, ie no indices, just positionis, then add vertices, then add another triangle, then try to reduce the number of positions and uvs, and use index attribute, and then try to split the two UV triangles, while keeping the positions (it actually can’t be done, so you will revert to the triangle soup). I think this will clarify a lot.
Also, if you own the entire pipeline, make a plane in 3ds and export that, post the result here.