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

251
Views
How to efficiently compute the visible points on a sphere?

I have a lot of small points to draw on the surface of a sphere. They are located by two angles lat ∈ [-PI/2,PI/2] and long ∈ [-PI,PI] and the same radius R.

My camera is pointing directly at the center of the sphere, and is also located with angles lat and long. Its distance from the center can vary though, but is always greater than R, let's call it d.

For each visible points, I have to make other calculations in addition to the actual rendering, so to make the animation loop faster I would like to know which ones are visible and which ones are not.

What I have tried :

Don't render them if this condition is true : Math.abs(point.position.long - camera.position.long) > Math.PI/4 && Math.abs(point.position.lat - camera.position.lat) > Math.PI/4

Which only work when the camera's latitude is 0, because if you are at a pole the range of longitudes you want to see is actually 2*PI, but you want a reduced latitude range.

I then tried taking latitude into account when calculating the longitude range, by using Math.PI/4 + 3/2*Math.abs(this.rotation.lat) instead of just Math.PI/4 and it is better but still not perfect.

I would like to know how I could achieve this, and in the best case scenario take into account the camera's settings, maybe with its projection or model view matrices (I use THREE.js so they are readily available) to really reduce the number of points rendered.

Thanks a lot,

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