3d-tiles not loaded

458 views
Skip to first unread message

guojins...@gmail.com

unread,
Jun 21, 2017, 12:34:09 AM6/21/17
to cesium-dev
As I know the cesium 3d-tiles branch was merged into master,so I use master to load 3d-tiles,but the model was not loaded. the code as below , the function 'allTilesLoaded' and 'readyPromise' were not excuted, What's the problem?

------------------------------------------------------------------------------------
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url:'http://localhost:8098/tileset.json',
dynamicScreenSpaceError : true,
dynamicScreenSpaceErrorDensity : 0.00278,
dynamicScreenSpaceErrorFactor : 4.0,
dynamicScreenSpaceErrorHeightFalloff : 0.25
}));



tileset.allTilesLoaded.addEventListener(function() {
console.log('loaded');
});


tileset.readyPromise.then(function(tileset) {

console.log('start Load');

var boundingSphere = tileset.boundingSphere;
viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0, -2.0, 0));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, -4000);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
console.log(tileset.modelMatrix);
});

Rachel Hwang

unread,
Jun 22, 2017, 12:17:26 PM6/22/17
to cesium-dev, guojins...@gmail.com
Hi there,

Double check your tileset path -- I tested your code with a path to one of our sample tilesets and it runs just fine.

Also, be careful. You're translating the tileset down 4000 meters, so it may be under the terrain.

Hope that helps,
- Rachel

ene...@seas.upenn.edu

unread,
Jun 22, 2017, 1:36:27 PM6/22/17
to cesium-dev, guojins...@gmail.com
I'm having the same issue after switching to the master branch. I'm not translating my tileset at all so I know that's not the issue. I load in my tiles the same way as above and am also observing that

tileset.readyPromise.then(function () {...});

is never executing. If I switch back to the Cesium.js from the 3d-tiles branch, I don't have this issue.

Sean Lilley

unread,
Jun 22, 2017, 11:28:35 PM6/22/17
to cesium-dev, guojins...@gmail.com, ene...@seas.upenn.edu
You can also check if an error occurred with:

tileset.readyPromise.then(function (){...}).otherwise(function(error) {console.log(error);});

guojins...@gmail.com

unread,
Jun 23, 2017, 2:41:45 AM6/23/17
to cesium-dev, guojins...@gmail.com, ene...@seas.upenn.edu
the error msg shown in otherwise function as below:

t {name: "RuntimeError", message: "geometricError must be defined", stack: "Error↵ at new t (http://localhost:8026/App/Cesi…://localhost:8026/App/Cesium/Cesium.js:516:27615)"}message: "geometricError must be defined"name: "RuntimeError"stack: "Error↵ at new t (http://localhost:8026/App/Cesium/Cesium.js:518:3793)↵ at new O (http://localhost:8026/App/Cesium/Cesium.js:569:30954)↵ at U.loadTileset (http://localhost:8026/App/Cesium/Cesium.js:571:7022)↵ at http://localhost:8026/App/Cesium/Cesium.js:570:31031↵ at i.then (http://localhost:8026/App/Cesium/Cesium.js:516:27615)↵ at http://localhost:8026/App/Cesium/Cesium.js:516:28189↵ at m (http://localhost:8026/App/Cesium/Cesium.js:516:29571)↵ at f (http://localhost:8026/App/Cesium/Cesium.js:516:28325)↵ at r (http://localhost:8026/App/Cesium/Cesium.js:516:27823)↵ at i.then (http://localhost:8026/App/Cesium/Cesium.js:516:27615)"__proto__: Error

guojins...@gmail.com

unread,
Jun 23, 2017, 8:09:46 AM6/23/17
to cesium-dev, guojins...@gmail.com
can you give me the cesium.js file directly; I'm sure that the tileset path was right

ene...@seas.upenn.edu

unread,
Jun 23, 2017, 8:26:23 AM6/23/17
to cesium-dev, guojins...@gmail.com, ene...@seas.upenn.edu
I have the same error message. Did an optional property of the Cesium3DTileset constructor get changed to required when the branch got merged with master?

Sean Lilley

unread,
Jun 24, 2017, 5:27:21 PM6/24/17
to cesium-dev, guojins...@gmail.com, ene...@seas.upenn.edu
Geometric error is required for every tile, but previously the engine was not checking whether it actually existed. Most likely this resulted in a bunch of checks against 'undefined' which may have accidentally worked due to the nature of JavaScript.

For anyone else stumbling upon this thread, a fix for this problem is here: https://groups.google.com/d/msg/cesium-dev/3p5XyXAzkbs/LOwd6rYdBgAJ
Reply all
Reply to author
Forward
0 new messages