# Migration from Geometry's faceVertexUvs to BufferGeometry

Hi,

I’ve gone through existing topics, but could not find anything that assists me in converting the following code to BufferGeometry.

It’s been years since this was put together, without any documentation on the code, so I’m not even sure what this is doing. What I observe, however, is that this essentially decides on which faces should show the texture.

How could I achieve the same with the “new” BufferGeometry?

``````    const sgeo = this.geometry;
const vs = sgeo.vertices;
const faces = sgeo.faces;
const fuv = sgeo.faceVertexUvs;

const xlength = this.xlength;
const ylength = this.ylength;

for (var i = 0; i < fuv.length; i++) {

// Face uv
const f = fuv[i];
let x, y;

f.xp  = vs[faces[i].a].x;
f.yp = vs[faces[i].a].y

f.xp  = vs[faces[i].b].x;
f.yp = vs[faces[i].b].y

f.xp  = vs[faces[i].c].x;
f.yp = vs[faces[i].c].y

for (var j = 0; j < 3; j++) {

f[j].x = (f[j].xp + this.offset.x) / xlength * nhs * o.hs + (ou - o.ou * nhs);
f[j].y = (f[j].yp + this.offset.y) / ylength * vhs * o.vs + (ov - o.ov * vhs);
}
}
this.geometry.uvsNeedUpdate = true;
this.setTexture(tex);
``````

Thanks for assistance!