why i donot load .b3dm file?

319 views
Skip to first unread message

6129...@qq.com

unread,
Nov 12, 2016, 10:47:42 AM11/12/16
to cesium-dev
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",but the "http://localhost:8080/apps/Learn/tilesets/TilesetWithDiscreteLOD/dragon_medium.b3dm?v=0.0" is ok.

so how i solve this problem? thank you !

Sean Lilley

unread,
Nov 14, 2016, 10:09:28 AM11/14/16
to cesium-dev, 6129...@qq.com
Can you post your full loading code? If you follow the sample code in https://github.com/AnalyticalGraphicsInc/3d-tiles-samples it should be pretty smooth.

6129...@qq.com

unread,
Nov 15, 2016, 8:14:08 PM11/15/16
to cesium-dev, 6129...@qq.com
在 2016年11月14日星期一 UTC+8下午11:09:28,Sean Lilley写道:

黄桦

unread,
Nov 16, 2016, 12:57:30 AM11/16/16
to cesium-dev
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 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"
        }
 }
]
  }


------------------ 原始邮件 ------------------
发件人: "黄桦";<6129...@qq.com>;
发送时间: 2016年11月16日(星期三) 上午9:14
收件人: "cesium-dev"<cesiu...@googlegroups.com>;
抄送: "黄桦"<6129...@qq.com>;
主题: [cesium-dev] Re: why i donot load .b3dm file?
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/SlBRSuIqZ6I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

35FCFE12@476F6930.27F52B58
3903F609@476F6930.27F52B58
32FDFB0F@476F6930.27F52B58

黄桦

unread,
Nov 16, 2016, 3:25:50 AM11/16/16
to cesium-dev
        var viewer = new Cesium.Viewer('cesiumContainer', {
scene3DOnly : true
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
}));

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({
requestVetexNormals:true,
requestWaterMask:true
});
viewer.terrainProvider = localterrainprovider;






------------------ 原始邮件 ------------------
发件人: "黄桦";<6129...@qq.com>;
发送时间: 2016年11月16日(星期三) 中午1:56
收件人: "cesium-dev"<cesiu...@googlegroups.com>;
主题: 回复:[cesium-dev] Re: why i donot load .b3dm file?
84976A7B@BE576A6C.01182C58
7684A1EF@BE576A6C.01182C58
816070A6@BE576A6C.01182C58
3201F609@BE576A6C.01182C58
3805F906@BE576A6C.01182C58

Sean Lilley

unread,
Nov 18, 2016, 10:24:31 AM11/18/16
to cesium-dev, 6129...@qq.com
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({
    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);
}); 



黄桦

unread,
Nov 18, 2016, 9:14:47 PM11/18/16
to cesium-dev
thank you very much, this problem has solved.


------------------ 原始邮件 ------------------
发件人: "Sean Lilley";<lill...@gmail.com>;
发送时间: 2016年11月18日(星期五) 晚上11:24
收件人: "cesium-dev"<cesiu...@googlegroups.com>;
抄送: "黄桦"<6129...@qq.com>;
主题: Re: 回复:[cesium-dev] Re: why i donot load .b3dm file?
Reply all
Reply to author
Forward
0 new messages