Currently, I am utilizing three.js to create curved shapes using parametric functions. Within the THREE.js javascript file, there is a function called THREE.ParametricGeometry that continuously adds 2D vectors to the faceVertexUvs array. I am curious about the purpose of this and how exactly the faceVertexUvs array functions.
var a, b, c, d;
var uva, uvb, uvc, uvd;
var uvs = this.faceVertexUvs[0];
for ( i = 0; i < stacks; i++ ) {
for ( j = 0; j < slices; j++ ) {
a = i * sliceCount + j;
b = i * sliceCount + j + 1;
c = (i + 1) * sliceCount + j + 1;
d = (i + 1) * sliceCount + j;
uva = new THREE.Vector2(j/slices, i/stacks);
uvb = new THREE.Vector2((j+1)/slices, i/stacks);
uvc = new THREE.Vector2((j+1)/slices, (i+1)/stacks);
uvd = new THREE.Vector2(j/slices, (i+1)/stacks);
faces.push(new THREE.Face3(a, b, d));
uvs.push([uva, uvb, uvd]);
faces.push(new THREE.Face3(b, c, d));
uvs.push([uvb.clone(), uvc, uvd.clone()]);
}
}