Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!