1

您好,在此先感谢您,

我正在尝试了解 UV - 我创建了PlaneGeometry,但我无法使 UV 工作。
链接到我的尝试:
https
://student.sps-prosek.cz/~eisead11it/web/WebGL/4th%20project/ 在我的页面上,我制作了一个按钮并测试纹理,因此您可以自己查看错误。
为简单起见,我尝试制作的几何图形命名为Empty,平面命名为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";
4

0 回答 0