CesiumGS / CesiumGS/cesium

Adding BoxGraphics to an Entity positioned at origin crashes

Open
#9,252 2 comments 0 reactions 0 assignees View on GitHub
category - graphics type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Sandcastle: [Link](https://sandcastle.cesium.com/#c=rVNNb9swDP0rhE8OEMj92iVzg61pbgFSdFuLFr4oNhsTlUVDlON2Q//7ZLtNv9JdOl9kku898VFSzlY8bAhbdHAMFluYoVBTqYs+F2dR3scztl6TRZdFo6+ZHRhKcrSo1oZXqKTkNkjcaCMYEJnNe22nC2okFPb3+q8vJQn8LEmgZXcr6gnKjtZkz5isD/jHLdB68oSidFHEfzILULOEDNvJU6sz7Xz40/ZQXc/Pl+MBFFQm0BNCRHdoftBvnMDReEjlbNg9S3SRupovFsvLrv6Q2YfRP1qVukSHn+4SjaFamIptp924aPLyIJ558TDLMbxeR4+OKu3RkTZvTJ3PT1VLvvxu6lLHe+rgy2i3w4JRwLLvrW6drvju0zaDxtZgQRVaCQz5ry5PFr/mH9uMxlEq/t7gdBAB+EZVzc5D40ysVOKxqk1QlmTV5LfoVS7STaeDpslLalrQBqg43vEwIDdaJFRuGtPftiyapknAv6MaDp7serlBZ/R9Byv3p4shqZRKkxDuZnpms9LujfJf)
Browser: Mozilla Firefox Version 83.0 (64-bit)
Operating System: Windows 10 Home 20H2

---

Adding a [`box`](https://cesium.com/docs/cesiumjs-ref-doc/Entity.html?classFilter=entit#box) to an entity positioned at [`Cartesian3.ZERO`](https://cesium.com/downloads/cesiumjs/releases/1.60/Build/Documentation/Cartesian3.html?classFilter=cartes#.ZERO) causes a crash.

```
const box = viewer.entities.add({
position: Cesium.Cartesian3.ZERO,
box: {
dimensions: new Cesium.Cartesian3(100.0, 100.0, 100.0),
material: Cesium.Color.BLUE.withAlpha(0.25)
}
});
```

Crash Log:

```
An error occurred while rendering. Rendering has stopped.
TypeError: cartographic is undefined
GeographicProjection.prototype.project@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:4082:13
updateBatchTableBoundingSpheres@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:112949:35
Primitive.prototype.update@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:113559:38
PrimitiveCollection.prototype.update@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:196435:21
PrimitiveCollection.prototype.update@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:196435:21
PrimitiveCollection.prototype.update@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:196435:21
updateAndRenderPrimitives@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:283075:23
executeCommandsInViewport@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:282850:32
Scene.prototype.updateAndExecuteCommands@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:282593:32
render@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:283469:11
tryAndCatchError@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:283488:24
Scene.prototype.render@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:283578:23
CesiumWidget.prototype.render@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:297724:19
render@https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:296979:20
```

This may be related to https://github.com/CesiumGS/cesium/issues/6365.

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash from the linked Sandcastle example with an entity at Cartesian3.ZERO. Start by tracing GeographicProjection.project and updateBatchTableBoundingSpheres from the reported stack, then verify that adding the box no longer stops rendering and that ordinary positioned entities still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.