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

192
Visualizações
How to perform relative rotations to other objects threejs?

I am trying to make a perspective camera go through a portal like in the game Portal, and rotate relative to the portal face it comes out of so you are facing the same way the exit portal is facing while keeping the same viewpoint you had when entering a portal. I have tried to implement this using getWorldDirection() like so:

      var portalNormal = new THREE.Vector3();
      portal.getWorldDirection(portalNormal);

      var exitPortalNormal = new THREE.Vector3();
      exitPortal.getWorldDirection(exitPortalNormal );

      var camNormal = new THREE.Vector3();
      camera.getWorldDirection(camNormal);

      camNormal.add(portalNormal);
      camNormal.sub(portalLinkNormal);

      camera.lookAt(camNormal)

This code seems to almost work, but the camera never rotates quite right. Thanks for the help! And also let me know if I'm asking the right question because I'm not sure quite how to word it.

about 4 years ago · Juan Pablo Isaza
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