PolylineGeometry 2D rendering incorrectly at certain zoom levels
- Dominant language
- JavaScript
- Stars
- 15.8k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
1. A concise explanation of the problem you're experiencing.
While in 2D polylineGeometry are not being rendered correctly at certain zoom levels. Occassionally the graphic appears to extend down towards the lower left corner of screen. In 3D it appears to render properly. It seems to be related to the Z component is equal to 0.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Once the globe appears click on the 2D (scene picker) button and zoom in/out slowly. At some zoom levels you will see the line exten down to the lower left corner of the screen.
var geomInst = null;
var linePoints = null;
var primitive = null;
var sceneModePicker = null;
var viewer = null;
viewer = new Cesium.CesiumWidget('cesiumContainer');
sceneModePicker = new Cesium.SceneModePicker('sceneButton', viewer.scene, 0);
linePoints = [-71.19881, 41.6785, 0,
-71.19994, 41.46332, 0,
-71.11713, 41.49306, 0,
-71.14121, 41.65527, 127,
-71.19881, 41.6785, 0];
geomInst = new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: Cesium.Cartesian3.fromDegreesArrayHeights(linePoints),
width: 1.0,
vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT,
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
});
primitive = new Cesium.Primitive({
geometryInstances: geomInst,
interleave : true,
appearance: new Cesium.PolylineColorAppearance()
});
viewer.scene.primitives.add(primitive);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
The only thing that is a little different is that I am using the Cesium Widget and the Geometry API. I am using the widget for performance reasons I only need to deal with a large set of Geometries.
4. The Cesium version you're using, your operating system and browser.
Cesium version 35, Windows 7, Chrome 59.0.3071.115 verified that this is a problem with the latest Firefox ESR release as well.
This has been reported to the Cesium forum and a picture is attached to the thread.
Contributor guide
Research direction
Start by reproducing the issue with the provided CesiumWidget, SceneModePicker, and PolylineGeometry example, switching between 2D and 3D while changing zoom levels. Trace the PolylineGeometry rendering path for positions whose Z component is zero and compare its 2D behavior with 3D. Done means the sample polyline no longer extends toward the lower-left corner at affected zoom levels.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100