Hello and thanks in advance,
I am trying to understand UVs - I created PlaneGeometry
, but I can't make the UVs work.
Link to my attempt:
https://student.sps-prosek.cz/~eisead11it/web/WebGL/4th%20project/
On my page I made a button and test texture, so you can see the error yourself.
For simplicity the geometry I am trying to make work is named Empty and the plane is named Plane.
var Empty = new THREE.Geometry();
Empty.vertices.push(
new THREE.Vector3(-0.5,-0.5,-0.5),new THREE.Vector3(0.5,-0.5,-0.5),
new THREE.Vector3(-0.5,-0.5,0.5),new THREE.Vector3(0.5,-0.5,0.5)
);
Empty.faces.push(new THREE.Face3(0,2,1));
Empty.faces.push(new THREE.Face3(3,1,2));
Empty.computeFaceNormals();
Empty.faceVertexUvs[0]=[];
Empty.faceVertexUvs[0].push([
new THREE.Vector2( 0, 1 ),
new THREE.Vector2( 0, 0 ),
new THREE.Vector2( 1, 1 ),
]);
Empty.faces[0].materialIndex = 0;
Empty.faceVertexUvs[0].push([
new THREE.Vector2( 0, 0 ),
new THREE.Vector2( 1, 0 ),
new THREE.Vector2( 1, 1 ),
]);
Empty.faces[1].materialIndex = 0;
Empty.name="Empty";