CesiumGS / CesiumGS/cesium

Camera.computeViewRectangle doesn't work in 2D or CV

Open
#4,346 24 comments 3 reactions 0 assignees View on GitHub
category - 2d / columbus view category - camera priority - high type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/Ildibeod608

``` javascript
var viewer = new Cesium.Viewer('cesiumContainer', {
sceneMode: Cesium.SceneMode.SCENE2D
});

viewer.scene.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(-90, 43, 50000),
duration: 0,
});

viewer.camera.moveEnd.addEventListener(logViewRectangle);

function logViewRectangle() {
console.log('camera.computeViewRectangle() is ' + JSON.stringify(viewer.scene.camera.computeViewRectangle()));
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the provided Cesium Viewer example in SCENE2D and inspect Camera.computeViewRectangle() after camera.moveEnd. Compare its behavior in 2D and Columbus View, then make the result represent the visible camera rectangle in both modes and verify the reported example no longer returns an unusable result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.