Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
three.js, textures won't load in codepen

I'm starting to learn three.js, I'm doing it on codepen.io. The problem is that I try to add a texture to my boxgeometry and it does not appear, what is the problem with my code?

const cubetexture = new THREE.TextureLoader().load('https://i.stack.imgur.com/9vixO.png');

const geometry = new THREE.BoxGeometry( 10, 10, 10 )
const material = new THREE.MeshBasicMaterial( { map: cubetexture } );
const cube = new THREE.Mesh( geometry, material );
cube.rotateY(Math.PI / 3);
scene.add(cube)
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your image is being blocked because Imgur does not specify a CORS policy. Due to security reasons, modern browsers will refuse to load the image, as evident in the developer console:

Chromium console displaying failed image fetching

In this case, the easiest solution would be to re-upload your image to Imgur through the main site, and use the URL from there. i.stack.imgur.com (images uploaded through Stackoverflow) does not send the required CORS headers, but i.imgur.com (images uploaded through the main site) does.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda