# why i donot load .b3dm file?

**URL:** <https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801>\
**Category:** CesiumJS\
**Created:** [November 12, 2016, 3:47pm UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801 "2016-11-12T15:47:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://community.cesium.com/u/1115)\
**Post date:** [November 12, 2016, 3:47pm UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/1 "2016-11-12T15:47:42Z")

</div>

dear everyone, i have spent a lot of time to convert "LODTreeeExport.xml" to cesium3dtiles . when i load this 3dtiles,the web can not load b3dm file,the url is "[http://localhost:8080/apps/Learn/tilesets/TilesetWithDiscreteLOD/dragon\_medium.b3dm?v=0.0](http://localhost:8080/apps/Learn/tilesets/TilesetWithDiscreteLOD/dragon_medium.b3dm?v=0.0)",but the "[http://localhost:8080/apps/Learn/tilesets/TilesetWithDiscreteLOD/dragon\_medium.b3dm?v=0.0](http://localhost:8080/apps/Learn/tilesets/TilesetWithDiscreteLOD/dragon_medium.b3dm?v=0.0)" is ok.

so how i solve this problem? thank you !

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [November 14, 2016, 3:09pm UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/2 "2016-11-14T15:09:27Z")

</div>

Can you post your full loading code? If you follow the sample code in [https://github.com/AnalyticalGraphicsInc/3d-tiles-samples](https://github.com/AnalyticalGraphicsInc/3d-tiles-samples) it should be pretty smooth.

---

<div class="post-metadata">

**Author:** ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://community.cesium.com/u/1115)\
**Post date:** [November 16, 2016, 1:14am UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/3 "2016-11-16T01:14:08Z")

</div>

在 2016年11月14日星期一 UTC+8下午11:09:28，Sean Lilley写道：

---

<div class="post-metadata">

**Author:** ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://community.cesium.com/u/1115)\
**Post date:** [November 16, 2016, 5:56am UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/4 "2016-11-16T05:56:55Z")

</div>

thank you Sean Lilley, i have solved the problem. and now i have another problem. when i create tileset.json, i dot not know how to caculate the value of every tile’s GeometryError. i have use b3dmConvertor.js to convert LODTreeeExport.xml(lots of .dae files). and i use the tileset.json which is created by myself, when load this tile ,it is below the scene , it will not see.,i '[https://assets.agi.com/stk-terrain/world](https://assets.agi.com/stk-terrain/world) as terrainprovider, just like this ,what is the problem. this is the height problem of the data.

how can i put the data on the plane and use wold terrainprovider.

thank you very much.

![]()

if donot use terrainprovider ,the data is very high.

![]()

![]()

{

“asset”: {

“version”: “0.0”

},

“geometricError”: 100,

“root”: {

“boundingVolume”: {

“region”: [

1.791628438775456,

0.43636019940414406,

1.7916428419884687,

0.43637323794669985,

1877.1792471749675,

1884.2476457060009

]

},

“geometricError”: 16,

“content”: {

“url”: “Tile\_1320320231311111231\Tile\_1320320231311111231.b3dm”

},

“refine”: “add”,

“children”: [

{

“boundingVolume”: {

“region”: [

1.7916284387753736,

0.4363602025550738,

1.7916425045992321,

0.43637303947379535,

1877.1792475360458,

1894.247680962341

]

},

“geometricError”: 8,

“content”: {

“url”: “Tile\_1320320231311111231\Tile\_1320320231311111231\_L16\_0.b3dm”

}

}

]

}

}

![35FCFE12@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/d/d87b05a5ca368dfdf230a8a4ebfa5bcb4aba8c6a.png)

 ![3903F609@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/b/bc82e493d3549c201d4319b273c6b029927415c5.png)

 ![32FDFB0F@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/6/60867d17d2c2da183c597ab221720e04a45a0947.png)

---

<div class="post-metadata">

**Author:** ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://community.cesium.com/u/1115)\
**Post date:** [November 16, 2016, 8:25am UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/5 "2016-11-16T08:25:37Z")

</div>

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

scene3DOnly : true

});

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url : ‘[http://localhost:8080/gltf2b3dm/output/](http://localhost:8080/gltf2b3dm/output/)’

}));

tileset.readyPromise.then(function(tileset) {

viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));

viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

});

![]()

the data leave the ground is very high. if add terrainprovide, the data will disappear very soon.

var localterrainprovider = new Cesium.CesiumTerrainProvider({

url:‘[https://assets.agi.com/stk-terrain/world](https://assets.agi.com/stk-terrain/world)’,

requestVetexNormals:true,

requestWaterMask:true

});

viewer.terrainProvider = localterrainprovider;

![]()

![35FCFE12@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/d/d87b05a5ca368dfdf230a8a4ebfa5bcb4aba8c6a.png)

 ![3903F609@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/b/bc82e493d3549c201d4319b273c6b029927415c5.png)

 ![32FDFB0F@476F6930.27F52B58.png](https://global.discourse-cdn.com/cesium/original/2X/6/60867d17d2c2da183c597ab221720e04a45a0947.png)

 ![3201F609@BE576A6C.01182C58.jpg](https://global.discourse-cdn.com/cesium/original/2X/5/523f29f78c8c4f608c019a2b3282b45f9531bf29.jpeg)

 ![3805F906@BE576A6C.01182C58.png](https://global.discourse-cdn.com/cesium/original/2X/3/3ee14910686abd82f735099be8f490c7739c1ee7.png)

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [November 18, 2016, 3:24pm UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/6 "2016-11-18T15:24:30Z")

</div>

Tilesets do not conform to terrain, so in this case your tileset hovers over the globe when terrain is off and is below the globe when terrain is on. It seems like you may need to do some tweaking to the position of your tileset to have it placed where you like. This sample code may help out my setting the tileset’s modelMatrix:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

```
scene3DOnly : true

```

});

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({

```
url : 'https://assets.agi.com/stk-terrain/world',

requestWaterMask : true,

requestVertexNormals : true

```

});

viewer.terrainProvider = cesiumTerrainProviderMeshes;

var scene = viewer.scene;

var heightOffset = 23.0;

var url = ‘tileset.json’;

var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({

```
url : url

```

}));

tileset.readyPromise.then(function(tileset) {

```
var boundingSphere = tileset.boundingSphere;

viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0, -2.0, 0));

viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

// Position tileset

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, heightOffset);

var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());

var matrix = Cesium.Matrix4.fromTranslation(translation);

tileset.modelMatrix = matrix;

var transform = Cesium.Matrix4.pack(matrix, new Array(16));

console.log(transform);

```

});

``

---

<div class="post-metadata">

**Author:** ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://community.cesium.com/u/1115)\
**Post date:** [November 19, 2016, 2:14am UTC](https://community.cesium.com/t/why-i-donot-load-b3dm-file/4801/7 "2016-11-19T02:14:43Z")

</div>

thank you very much, this problem has solved.
