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

154
Visualizações
Find the objects that a line intersects in three.js

Currently, I'm working on a three.js project where I should select two boxes from a board and draw a straight line connecting them, then I must highlight all the boxes that the line intersects. My big question now is how to to find which boxes the line intersects?

Any help would be appreciated (piece of code, links, material suggestion, math formulas)

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

0

What you're describing sounds like you're looking for a Raycast.

You set up your ray (it's position and direction vector), and then use intersectObjects on the objects to get an array of the boxes the ray intersects.

about 4 years ago · Juan Pablo Isaza Relatório

0

What I really needed in this case was bresenhams line algorithm, with this I can track all different points that the line crosses.

Found at https://www.geeksforgeeks.org/bresenhams-line-generation-algorithm/

Thanks Ivan and Diarmid, I know my code was a big mess and you tried to help me despite that.

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