# Can i use gltf files in 3dtiles directly or do i have to convert to b3dm?

**URL:** <https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859>\
**Category:** CesiumJS\
**Created:** [June 11, 2020, 1:58am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859 "2020-06-11T01:58:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 11, 2020, 1:58am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/1 "2020-06-11T01:58:50Z")

</div>

Newbie question: Can i use plain gltf files in 3dtiles directly or do i have to convert to b3dm?  
I tried to swap in a box from gltf repro with a tile example using b3dm and got:  
A 3D tile failed to load: [[http://127.0.0.1:8085/Box.gltf?v=1.2.3](http://127.0.0.1:8085/Box.gltf?v=1.2.3)]  
Error: Cannot read property ‘content’ of undefined

“root”: {  
“boundingVolume”: {  
“region”: [  
-1.3197209591796106,  
0.6988424218,  
-1.3196390408203893,  
0.6989055782,  
0,  
88  
]  
},  
“geometricError”: 70,  
“refine”: “ADD”,  
“content”: {  
“uri”: “Box.gltf”,  
“boundingVolume”: {  
“region”: [  
-1.3197004795898053,  
0.6988582109,  
-1.3196595204101946,  
0.6988897891,  
0,  
88  
]  
}  
},

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [June 11, 2020, 2:21am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/2 "2020-06-11T02:21:11Z")

</div>

The 3D Tiles specification requires wrapping glTF models as b3dm. There are plans to support glTF directly as a tile format, see: [https://github.com/CesiumGS/3d-tiles/issues/385](https://github.com/CesiumGS/3d-tiles/issues/385)

Are you writing a 3D Tiles generator or client implementation?

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 11, 2020, 2:29am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/3 "2020-06-11T02:29:34Z")

</div>

Thanks for the quick reply, maybe i can use  
[https://github.com/CesiumGS/3d-tiles-validator](https://github.com/CesiumGS/3d-tiles-validator) for that.

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 11, 2020, 8:40am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/4 "2020-06-11T08:40:37Z")

</div>

Got my .b3dm. Is there a viewer for that format that isnt cesium?  
I cannot see my tiles in sandcastle (no errors) and hard to tell if its the data or placement. I guess common problem.

And I a probably doing that ;D  
If there’s no error, I’m guessing the problem is that the model itself isn’t in the bounding volume. If it’s origin is (0,0,0) then the model is going to be at the center of the earth. The region defined does not actually move or transform the model. You would need to either move the model itself (in the OBJ before exporting it) or by defining a transform to move it to the right location. So you can see how the tileset.json in this tileset defines a transform to move the model to the right location

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [June 11, 2020, 12:04pm UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/5 "2020-06-11T12:04:42Z")

</div>

Have you tried using the 3D Tiles inspector (see [https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Inspector.html](https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Inspector.html)) to debug this?

Also, what’s the format of your source data? If it’s not something Cesium ion supports tiling yet we can consider it for the roadmap.

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 12, 2020, 5:35am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/6 "2020-06-12T05:35:54Z")

</div>

We have user defined data and that needs to converted on the fly. For development i would love to see just my processed mesh data in a viewer quickly but i couldn’t find one. Gltf viewers arent expected to work?  
The transform matrix has no scale, so i have to do that in the mesh probably?  
[ Xx, Xy, Xz, 0,  
Yx, Yy, Yz, 0,  
Zx, Zy, Zz, 0,  
RTCx, RTCy, RTCz, 1]

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 13, 2020, 8:35am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/7 "2020-06-13T08:35:46Z")

</div>

![image](https://global.discourse-cdn.com/cesium/original/2X/b/b267e9138c5bdff3ae05c7c5924362eaa3713e58.jpeg)  
dropped a cube in the dragon tileset. Blender doesnt like b3dm unfortunately

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 16, 2020, 5:11am UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/8 "2020-06-16T05:11:11Z")

</div>

The tile inspector shows the wire frame of my regular triangle grid like this, I am puzzled how i see quads? There must be a b3dm reader out there … a bit complicated

> **[NASA-AMMOS/Unity3DTiles](https://github.com/NASA-AMMOS/Unity3DTiles)**
>
> A 3D Tiles implementation in Unity. Contribute to NASA-AMMOS/Unity3DTiles development by creating an account on GitHub.

  
 ![image](https://global.discourse-cdn.com/cesium/original/2X/e/e210ad69066df91c168276892ea7e4a089adfef7.jpeg)

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [June 16, 2020, 2:57pm UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/9 "2020-06-16T14:57:19Z")

</div>

Can you upload your b3dm here? Either attach a zip or upload the example tileset to Cesium ion and post a Sandcastle example.

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [June 16, 2020, 11:06pm UTC](https://community.cesium.com/t/can-i-use-gltf-files-in-3dtiles-directly-or-do-i-have-to-convert-to-b3dm/9859/10 "2020-06-16T23:06:51Z")

</div>

Thanks, for looking. I am just trying to figure out my test workflow if i cannot see a real wire frame of my mesh. Or the mesh gets changed in the process… Would we expect conversion to b3dm simplifies meshes in that way?

I was looking at in inspector sandcastle example with  
var tileset = new Cesium.Cesium3DTileset({  
url: “[http://127.0.0.1:8081/tileset.json](http://127.0.0.1:8081/tileset.json)”,  
});

[tileset.zip](https://community.cesium.com/uploads/short-url/jRc21CX6rkF0efjUeYn9HSR8ieV.zip) (400.0 KB)
