[Bug] GlobeView far plane clips data far above the surface, such as geostationary orbits

Open
#11,334 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

The far plane is computed in modules/core/src/viewports/globe-viewport.ts from altitude, GLOBE_RADIUS and farZMultiplier. Start by reproducing the report with a ScatterplotLayer at [135, 0, 35786000] and checking GlobeViewport.project depth at 800x600. Done means that point is drawn and pickable at the default view, or that the GlobeView docs state the far plane limit and when to set farZ. The issue leaves the fix open between the two, so confirm the direction with maintainers first.

Written by the indexing model from the issue text.

Description

Description

GlobeViewport sets the far plane to reach the far side of the globe (modules/core/src/viewports/globe-viewport.ts):

const farZ = opts.farZ ??
  (altitude + (GLOBE_RADIUS * 2 * scale) / height / Math.max(Math.cos(pitchRadians), 0.1)) * farZMultiplier;

Data far above the surface can be behind this plane. A geostationary orbit is 35,786 km high, so the far side of the GEO ring is about 6.6 Earth radii from the center of the globe. The far plane is 1 radius past the center. Thus, deck.gl clips the far half of the GEO ring, and picking misses those objects.

I measured this in the satellite example in deck.gl-community (visgl/deck.gl-community#1126): at the default view, 908 of 16,899 active satellites are behind the far plane. The example now sets farZMultiplier: 8.

Flavors
  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CARTO
  • ArcGIS
Expected Behavior

One of these:

  • The far plane includes the data, for example from the layer bounds or the largest altitude in the scene.
  • Or the GlobeView docs state the limit and say when to set farZMultiplier or farZ.
Steps to Reproduce
new Deck({
  views: new GlobeView(),
  initialViewState: {longitude: 0, latitude: 0, zoom: 0},
  layers: [
    new ScatterplotLayer({
      data: [{position: [135, 0, 35786000]}],   // far half of the GEO ring, not behind the globe
      getPosition: d => d.position,
      radiusMinPixels: 10
    })
  ]
});

The point does not draw, and picking does not find it. GlobeViewport.project (800x600) gives this depth for [lng, 0, 35786000]:

Longitude farZMultiplier: 1 farZMultiplier: 8
90 0.935 0.440
135 1.173 (clipped) 0.617
180 1.237 (behind the globe too) 0.664
Environment
  • Framework version: deck.gl master (10.0.0-alpha)
  • Browser: Chromium
  • OS: macOS
Logs

None.

Dominant language
TypeScript
Stars
14.8k
Forks
2.3k
Avg merge
1d 9h
Merged PRs (30d)
230

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/deck.gl

All issues in visgl/deck.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.