1

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";
gromiczek
  • 2,970
  • 5
  • 28
  • 49
Akxe
  • 9,694
  • 3
  • 36
  • 71
  • Maybe this viewer can help you: http://threejs.org/examples/misc_uv_tests.html – WestLangley Mar 16 '14 at 03:45
  • @WestLangley Well the link you gave me, it shows **Empty**'s UVs correctly... looks like a plane geometry – Akxe Mar 16 '14 at 12:03
  • Perhaps you can provide an easy-to-read and simple example apart from your project. Also explain in your post what is happening, and what should be happening. – WestLangley Mar 16 '14 at 15:39
  • There is a link it my post. It is the minimum, all JS is in main.min.js . And well I want to apply the texture to my geometry. The material is under **SelectionRed**, or ou can use the button in the GUI, test texture. – Akxe Mar 16 '14 at 16:56
  • 1
    1. Your UVs are messed up. 2. See http://stackoverflow.com/questions/16531759/three-js-map-material-causes-webgl-warning/16533812#16533812. – WestLangley Mar 16 '14 at 17:51

0 Answers0