I have been attempting to create a custom THREE.Geometry from scratch. However, when I try to use it with a THREE.Mesh, I encounter the following error:
TypeError: faces3 is undefined @ three.js:20426
The geometry is successfully created and displayed on the screen, although I am faced with this error message.
Below is the code snippet that I am currently using:
makePlane = function(width, height)
{
var geom = new THREE.Geometry();
var v0 = new THREE.Vector3(0, 0, 0);
var v1 = new THREE.Vector3(width, 0, 0);
var v2 = new THREE.Vector3(width, height, 0);
geom.vertices.push(v0);
geom.vertices.push(v1);
geom.vertices.push(v2);
var face = new THREE.Face3(0, 1, 2);
geom.faces.push(face);
return geom;
};
Can anyone provide insight into what additional steps may be required for proper functionality?
Update: The issue persists in version R62. This problem is not exclusive to custom geometries as it also occurs with geometry generated by three.js' built-in PlaneGeometry class. It's possible that this is a bug within three.js, and I intend to report it accordingly.
I must clarify that contrary to my previous statement, execution does not actually stop. I simply receive the error message and believe there should be no errors if everything is set up correctly.
Update 2: A related issue has been documented here, however, it appears to have been resolved and closed.