CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.75k stars 3.46k forks source link

An error occurred while rendering. Rendering has stopped. #11989

Closed c-Clithe closed 4 months ago

c-Clithe commented 4 months ago

What happened?

1715825059384

Reproduction steps

An error occurred when loading the 3D model. It was possible to load it before, but suddenly an error occurred

Sandcastle example

No response

Environment

Browser: CesiumJS Version: Operating System:

c-Clithe commented 4 months ago

cesium.js?v=4b2e33c3:220468 An error occurred while rendering. Rendering has stopped. TypeError: Cannot read properties of undefined (reading 'updateTransform') TypeError: Cannot read properties of undefined (reading 'updateTransform') at Cesium3DTileset.get (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:123443:18) at updateZoomTarget (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:251307:33) at Viewer._postRender (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:251255:3) at Event.raiseEvent (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:17669:20) at Scene4.render (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:219154:22) at CesiumWidget.render (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:220531:17) at render2 (http://localhost:8080/node_modules/.vite/deps/cesium.js?v=4b2e33c3:219954:18)

syzdev commented 4 months ago

Hi @c-Clithe, please supplement the version information, and then provide relevant sandcastle or tileset to help you better track the issue.

c-Clithe commented 4 months ago

@syzdev let translation = Cesium.Cartesian3.fromArray([0, 0, 0]); let m = Cesium.Matrix4.fromTranslation(translation); const url = "http://data.mars3d.cn/3dtiles/max-fsdzm/tileset.json"; let tilesetJson = { url, modelMatrix: m, show: true, // 是否显示图块集(默认true) }; const tileset = new Cesium.Cesium3DTileset(tilesetJson); viewer.scene.primitives.add(tileset);

syzdev commented 4 months ago

@c-Clithe If you want to update the position of the tileset, You can apply additional transformations with a model matrix, like in this example: https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Adjust%20Height.html

c-Clithe commented 4 months ago

It has been resolved, thank you~