supermedium/superframe

[atlas-uvs] broken in A-Frame 1.2+ due to three.js switch to buffer geometries

kfarr opened this issue · 4 comments

kfarr commented

When using atlas-uvs component and A-Frame 1.2 the console reports this error:
core:a-node:error Failure loading node: TypeError: Cannot read property '0' of undefined

Traced back to this line in the atlas-uvs component:
geometry.faceVertexUvs[0][0][0].copy(uvs[0]);

Proposed solution:

  • edit atlas-uvs/index.js to support buffer geometries

How? Not sure.

kfarr commented

Notes from three.js slack via @zadvorsky about converting from geometry to buffergeometry

Buffer geometry has a “uv” attribute (geometry.attributes.uv) you can access and modify. It’s a flat representation of the uvs, rather than indexed by face. It’s an instance of https://threejs.org/docs/#api/en/core/BufferAttribute. You can either modify the values in attributes.uv.array directly, or use of the methods to set values with specific offsets.
you may have to do some fiddling to find the correct mapping of your uvs and the geometry uvs

kfarr commented

fixed with #295