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

252
Visualizações
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 à 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