title: How to make a not squared texture fit in a "background-size:cover" way to a geometry plane in Three.js?
body: <p>I want my texture to have the same behaviour than the "background-size:cover" css property. </p>
  
  <p>I'd like to work with uvs coordinates. 
  I looked at this answer and start to work on a solution : <a href="https://stackoverflow.com/questions/27097884/three-js-efficiently-mapping-uvs-to-plane">Three.js Efficiently Mapping Uvs to Plane</a></p>
  
  <p>I try to have the same dimension/position planes that some div of my DOM.
  This is what I want : </p>
  
  <p><a href="https://i.stack.imgur.com/7h3WD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7h3WD.png" alt="enter image description here"></a></p>
  
  <p>And this is the result I get with this code : the dimension and position are good, the ratio of my texture looks good too but it seems like there's a scale issue : </p>
  
  <pre><code>            let w = domElmt.clientWidth / window.innerHeight;
              let h = domElmt.clientHeight / window.innerHeight;
              geometry = new THREE.PlaneGeometry(w, h);
  
              var uvs = geometry.faceVertexUvs[ 0 ];
              uvs[ 0 ][ 0 ].set( 0, h );
              uvs[ 0 ][ 1 ].set( 0, 0 );
              uvs[ 0 ][ 2 ].set( w, h );
              uvs[ 1 ][ 0 ].set( 0, 0 );
              uvs[ 1 ][ 1 ].set( w, 0 );
              uvs[ 1 ][ 2 ].set( w, h );
  
              tex = new THREE.TextureLoader().load('image.jpg'));
              tex.wrapS = tex.wrapT = THREE.RepeatWrapping;
  
              material = new THREE.MeshBasicMaterial( { map: tex } );
              mesh = new THREE.Mesh( geometry, material );
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1pAI5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1pAI5.png" alt="enter image description here"></a></p>
  
  <p>Should I play with the repeat attribute of my texture or can I fully made this behaviour using uvs ? Thank you</p>