# 3d models (glb) loading in different coordinates

**URL:** <https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374>\
**Category:** CesiumJS\
**Created:** [June 18, 2019, 2:21pm UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374 "2019-06-18T14:21:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshavardhan](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@harshavardhan](https://community.cesium.com/u/harshavardhan)\
**Post date:** [June 18, 2019, 2:21pm UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/1 "2019-06-18T14:21:07Z")

</div>

1. A concise explanation of the problem you're experiencing.

we are loading the 3d model (glb) using cesium .These models are provided by our clients.  
When are loading these models are rendering in different coordinates.  
Even when i specify particular location using modelMatrix.  
Attached sample file for your reference

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

var viewer = new Cesium.Viewer('cesiumContainer');  
&nbsp;&nbsp;&nbsp;&nbsp;var scene = viewer.scene;  
&nbsp;&nbsp;&nbsp;&nbsp;viewer.extend(Cesium.viewerCesiumInspectorMixin);  
&nbsp;&nbsp;&nbsp;&nbsp;var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(  
&nbsp;&nbsp;&nbsp;&nbsp;Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));  
var model = scene.primitives.add(Cesium.Model.fromGltf({  
&nbsp;&nbsp;&nbsp;&nbsp;url : '/assets/jayanagar.glb',  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;modelMatrix : modelMatrix,  
&nbsp;&nbsp;&nbsp;&nbsp;scale : 200.0  
}));

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.  
My client wants to load 3d models with shops images

4. The Cesium version you're using, your operating system and browser.  
latest version , using chrome browser

[jayanagar.glb](https://community.cesium.com/uploads/short-url/7dQP7190CALK99KMlRIsUIGHkS4.glb) (3.1 MB)

---

<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 20, 2019, 11:20pm UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/2 "2019-06-20T23:20:41Z")

</div>

Can you provide a full code example I can run on Sandcastle ([https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html)) ? For example, I don’t see how you’re defining the model matrix.

You should be able to position the model directly just by passing in a position, like in this example:

[https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html)

It would also help if you explain what you expect the correct position to be, and where they are showing up instead. For example, are they on the different side of the globe? Or just a few meters off? Or is just the orientation that’s incorrect, and the position is correct?

---

<div class="post-metadata">

**Author:** ![harshavardhan](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@harshavardhan](https://community.cesium.com/u/harshavardhan)\
**Post date:** [June 21, 2019, 4:06am UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/3 "2019-06-21T04:06:43Z")

</div>

Hi Omar,

Thanks for the response.

Here is my full code.  
\<html lang="en"\>  
\<head\>  
&nbsp;&nbsp;\<meta charset="utf-8"\>  
&nbsp;&nbsp;\<script src="[https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js](https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js)"\>\</script\>  
&nbsp;&nbsp;\<link href="[https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css](https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css)" rel="stylesheet"\>  
\</head\>  
\<body\>  
&nbsp;&nbsp;\<div id="cesiumContainer" style="width: 700px; height:400px"\>\</div\>  
&nbsp;&nbsp;\<script\>  
&nbsp;&nbsp;&nbsp;&nbsp;Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYTIxNzIxNC05MTU4LTRkMzYtYTk4My1jZjY2YWU1NzAwOTYiLCJpZCI6MTE1NjYsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJhc3ciLCJnYyJdLCJpYXQiOjE1NTkyMjY3OTR9.DbPDfD1Nnb9dDigvG6uh\_qmF-FHhIcZNhKTfiJAXha4';  
&nbsp;&nbsp;&nbsp;&nbsp;var viewer = new Cesium.Viewer('cesiumContainer');  
&nbsp;&nbsp;&nbsp;&nbsp;var scene = viewer.scene;  
&nbsp;&nbsp;&nbsp;&nbsp;// viewer.extend(Cesium.viewerCesiumInspectorMixin);  
&nbsp;&nbsp;&nbsp;&nbsp;var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(  
&nbsp;&nbsp;&nbsp;&nbsp;Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));  
&nbsp;&nbsp;&nbsp;&nbsp;var model = scene.primitives.add(Cesium.Model.fromGltf({  
&nbsp;&nbsp;&nbsp;&nbsp;url : '/assets/jayanagar.glb',  
&nbsp;&nbsp;&nbsp;&nbsp;modelMatrix : modelMatrix,  
&nbsp;&nbsp;&nbsp;&nbsp;scale : 200.0  
}));

&nbsp;&nbsp;\</script\>  
\</body\>  
\</html\>

I followed this link

> **[3D Models | cesium.com](https://cesium.com/docs/tutorials/3d-models/)**
>
> Draw and animate 3D models in CesiumJS using COLLADA and glTF.

Yes the 3d model is loading few metres off.

---

<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 25, 2019, 9:22pm UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/4 "2019-06-25T21:22:07Z")

</div>

Thanks for providing the sample code. One more thing to test out, can you try uploading the model to [cesium.com/ion](http://cesium.com/ion), and then using the positioning tool (click “Adjust Tileset Location” in the top right after it finishes uploading & tiling) to position it? Let me know if you’re able to get it in the right position visually using that tool.

---

<div class="post-metadata">

**Author:** ![harshavardhan](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@harshavardhan](https://community.cesium.com/u/harshavardhan)\
**Post date:** [July 24, 2019, 4:01am UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/5 "2019-07-24T04:01:33Z")

</div>

Hi Omar, I tried uploading model to ion and after uploading first it showed me a message like " Tileset location has not been set"

---

<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:** [August 6, 2019, 8:03pm UTC](https://community.cesium.com/t/3d-models-glb-loading-in-different-coordinates/8374/6 "2019-08-06T20:03:19Z")

</div>

You should now be able to position the tileset on Cesium ion. This link will take you to the dashboard with a tutorial in the bottom right that will show you how to do that:

[https://cesium.com/ion/assets/1?t=tilesetTransform](https://cesium.com/ion/assets/1?t=tilesetTransform)
