Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

Orbits have gaps when lines are triangulated

Open 375gnu opened this issue 1 year ago • 2 comments

Describe the bug First I found this bug with #1402 and I realized that I forgot to add NextPos for the last 2 vertices. But it persisted then I checked master and found it there.

To Reproduce Steps to reproduce the behavior:

  1. Update Renderer::shouldDrawLineAsTriangles() to always return true or use a device with max line thickness equal to 1px.
  2. Enable planet orbits
  3. Disable fading orbits
  4. Scroll to see all planets of the Solar system.
  5. See error

Expected behavior No gaps.

Screenshots image

Desktop (please complete the following information):

  • OS: any
  • Frontend: any
  • Version: 1.7.0

Additional context The same orbits with lines drawn as lines doesn't have gaps.

375gnu avatar Sep 03 '22 20:09 375gnu

it seems vec2 transform = normalize(nextPos.xy - thisPos.xy); resulted in nan, as thisPos and nextPos are the same.

levinli303 avatar Sep 09 '22 11:09 levinli303

one way to mitigate this issue might be passing in previous point as well, if we see nextPos == thisPos, calculate with prevPos == thisPos.

levinli303 avatar Sep 14 '22 11:09 levinli303