Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

250
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda