0

My uv map is loading like it's one side of a block:
enter image description here

Here is my code:

    const grass = new THREE.TextureLoader().load( 'https://raw.githubusercontent.com/Isaiah08-D/namelater/main/textures/blocks/grass.png' );
    
    
    const geometry = new THREE.BoxGeometry();
    const material = new THREE.MeshBasicMaterial({map:grass});
    ...

  var noise = new noisejs.Noise(Math.random());



    for (let x=0; x < 201; x += 10) {
      for (let z=0; z<201; z+=10) {
        //const chunk = getChunk(x, z)
        const cube = new THREE.Mesh(geometry, material)
        cube.position.x = x
        cube.position.z = z
        cube.position.y = noise.perlin2(x/100, z/100) * 100;
        cube.scale.set(10,10,10);
        blocklist.push(cube);
        scene.add( cube );
      }
    };

And you can find the uv map here. How do i get it to load so that each tile is one side: enter image description here etc.
Thanks in advance!

2
  • The wrapping is absolutely correct. The bottom left is (0, 0) and the top right is (1, 1). You are actually trying to wrap parts of the texture onto different sides of the cube. However, this is not a default behavior. Commented May 27, 2022 at 9:00
  • @Rabbid76 I changed my comment. Does this clarify things more? Commented May 27, 2022 at 11:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.