我正在尝试使用three.js在四边形上映射纹理,但纹理坐标似乎有问题,因为我看到的只是图像的左上角像素(UV = {0, 0} 我猜)...
这是我定义几何的方式:
var geom = new THREE.Geometry();
geom.vertices.push(new THREE.Vertex(new THREE.Vector3(-100, 50, 0)));
geom.vertices.push(new THREE.Vertex(new THREE.Vector3(-100, -50, 0)));
geom.vertices.push(new THREE.Vertex(new THREE.Vector3(0, -50, 0)));
geom.vertices.push(new THREE.Vertex(new THREE.Vector3(0, 50, 0)));
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.faces.push(new THREE.Face3(0, 2, 3));
geom.faceVertexUvs[0].push([new THREE.Vector2(0, 0),
new THREE.Vector2(10, 0),
new THREE.Vector2(10, 10)]);
geom.faceVertexUvs[0].push([new THREE.Vector2(0, 0),
new THREE.Vector2(10, 10),
new THREE.Vector2(0, 10)]);
//I also tried:
//geom.faceVertexUvs[0].push([new THREE.Vector2(0, 0),
// new THREE.Vector2(10, 0),
// new THREE.Vector2(10, 10),
// new THREE.Vector2(0, 0),
// new THREE.Vector2(10, 10),
// new THREE.Vector2(0, 10)]);
geom.computeCentroids();
geom.computeFaceNormals();
有人能发现我做错了什么吗?
谢谢