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

157
Visualizações
How to rotate a plane 90 degrees, with texture

I'm attempting to build an fps game, but when I go to rotate the floor anywhere close to 90 degrees it just vanishes from the scene. Here's the code responsible for the plane.

var colorMap = new THREE.TextureLoader().load('/textures/wood_albedo.png');

var radian = 2 * Math.PI *(90 / 360);
var geometry = new THREE.BoxGeometry(20, 20);

var material = new THREE.MeshStandardMaterial({color: 'white', side: THREE.DoubleSide});

var mesh = new THREE.Mesh(geometry, material);

scene.add(mesh);

I'm not sure what I'm doing wrong. Any help would be appreciated, thanks for reading.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your code seems fine, as I assume you are mapping the image to the plane behind the scenes. The only thing I would check is that 2 * Math.PI * (90 / 360) is the same thing as Math.PI / 2. Another thing you should check is that instead of white, it would be ideal to use a shade of grey for the map.

Your problem could have a simple solution - your rotation is making the plane parallel to the camera, making it invisible. You should typically keep your rotations in terms of Math.PI. Let me know if you have any further questions on this.

Tip: Adding a jsfiddle link could help greatly debug your problem.

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