# Changing model's center

**URL:** <https://community.cesium.com/t/changing-models-center/10883>\
**Category:** General\
**Created:** [September 10, 2020, 5:03pm UTC](https://community.cesium.com/t/changing-models-center/10883 "2020-09-10T17:03:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.gish](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dan.gish/32/3187_2.png) [@dan.gish](https://community.cesium.com/u/dan.gish)\
**Post date:** [September 10, 2020, 5:03pm UTC](https://community.cesium.com/t/changing-models-center/10883/1 "2020-09-10T17:03:43Z")

</div>

I’m adding various glTF models (I do not have control over their creation) into Cesium. Many of the models end up with strange boundingSpheres and centers in Cesium. Is there any way to edit the center pivot point of a model?

Note: The models originate as Collada files that I’m uploading to Cesium ION to convert into glTF.

---

<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:** [September 10, 2020, 5:51pm UTC](https://community.cesium.com/t/changing-models-center/10883/2 "2020-09-10T17:51:20Z")

</div>

I _think_ when converting a model to glTF with Cesium ion, it should retain its origin (vs tiling it to 3D Tiles, where it computes a new origin, see [How to correctly position 3D models when tiling with Cesium ion](https://community.cesium.com/t/how-to-correctly-position-3d-models-when-tiling-with-cesium-ion/10498/2)).

Are you seeing a different origin from the source model? Can you share a Sandcastle example showing this? See [How to share custom Sandcastle examples](https://community.cesium.com/t/how-to-share-custom-sandcastle-examples/9828)

---

<div class="post-metadata">

**Author:** ![dan.gish](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dan.gish/32/3187_2.png) [@dan.gish](https://community.cesium.com/u/dan.gish)\
**Post date:** [September 10, 2020, 6:37pm UTC](https://community.cesium.com/t/changing-models-center/10883/3 "2020-09-10T18:37:19Z")

</div>

It’s likely that the original Collada files have poor origins. So I’m looking for a way to change the origin programmatically, hopefully within Cesium, or if not by somehow editing the Collada or glTF files.

Here’s an example. As you can see the origin is far off from the actual model, and rotating it results in a big change in position.

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=bVJrT9swFP0rVj6lEnKaFRiwggYtoERpw6M8WkWaXOe2MXXs1nbKkon/Pid9jE2TIvlxzzn3nOt4HrpVRBjUA82KPHxEhFLQGhmJSlkoxKRARGswOhEbDA6kwCnMSMHNZQMeyQUIdI4SB8owm95SFrMweKoCf8gCHYiHI9oLjoPF8vW5F55iC1qlt4saxON+mI/zYT55bB8Nqkkeje6P4tHAxP2rbFi2f05GN3ncvy8H1U02qCiLeuFyYsUGVXA4rOZWfPg27VxxWgbHL7Y57QQ1RozLMK2x49d7Fr9d+/GIdgb9QTvup6f4pQhfVw/R8R1EkSrEyezGfynm0eTHfPWks8lhFn65y0OpTsg4cb4lIhFrotCawTsoG1PA+3Zc+Lm5cxOHNueeFIYwASpxWnveUsmcabDEP/N7AG2HSwHPbPGyHm+Quv7h6de230oEQthkINxZIaipH8BVW3wL/arLCNXCIAwzpdXdOMPNmYHGJE3dLQ6hpdSsFjnbte8RZeyOiE7TvQ9zBaDd9gGyn99utw521FymwM/QXgqhQrEztDOzx31sdx916MbdxpBRhC4gvd753BhuMB+bmNLmVO92Op+yglJS7YNSKbTkgLmcbytbvl2cA6erTcnhor76zvKlVMZ65C7GnoF8yYlN6k0L68JgqnVN6no7Sjdla8TS8/+8HqLc/vS2Mis4f2QVJM5F17P4v2hckpSJebwGxUlpIbWNbuZfRJsCxrjr2WPd9F+ukZJPifqk+xs)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

---

<div class="post-metadata">

**Author:** ![dan.gish](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dan.gish/32/3187_2.png) [@dan.gish](https://community.cesium.com/u/dan.gish)\
**Post date:** [September 11, 2020, 8:17pm UTC](https://community.cesium.com/t/changing-models-center/10883/4 "2020-09-11T20:17:18Z")

</div>

ION’s 3D Tiles does do a good job of computing the origin in the actual center of the model. However I need to programmatically move the model’s position in Cesium, and 3D Tiles can only have their position set manually in ION (I believe?).

So back to glTF models, where I can edit model.position but not model.boundingSphere. Again, any ideas on how to change the center pivot point within the model would be appreciated!

---

<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:** [September 16, 2020, 12:09am UTC](https://community.cesium.com/t/changing-models-center/10883/5 "2020-09-16T00:09:03Z")

</div>

> [@dan.gish](#):
>
> However I need to programmatically move the model’s position in Cesium, and 3D Tiles can only have their position set manually in ION (I believe?).

There’s a couple of ways to programmatically position your model. My recommendation is to use the Cesium ion REST API to upload your model and pass in a longitude, latitude, and height. This will allow you to accurately position where the origin of your geometry should be on the globe.

> [@dan.gish](#):
>
> any ideas on how to change the center pivot point within the model would be appreciated

I don’t think this is possible in CesiumJS - you would need to reposition your model geometry itself in the glTF file before importing. Or one easy thing I’ve seen many glTF models do is create an empty root node that acts as an offset so you can easily translate the origin without editing all the geometry.

---

<div class="post-metadata">

**Author:** ![dan.gish](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dan.gish/32/3187_2.png) [@dan.gish](https://community.cesium.com/u/dan.gish)\
**Post date:** [September 19, 2020, 6:24pm UTC](https://community.cesium.com/t/changing-models-center/10883/6 "2020-09-19T18:24:26Z")

</div>

> [@omar](#):
>
> There’s a couple of ways to programmatically position your model. My recommendation is to use the Cesium ion REST API to upload your model and pass in a longitude, latitude, and height. This will allow you to accurately position where the origin of your geometry should be on the globe.

In this case I need to rapidly change the model’s location locally, so calling the REST API each time for the 3D Tiles model wouldn’t work. Any other ways to do it?

> [@omar](#):
>
> I don’t think this is possible in CesiumJS - you would need to reposition your model geometry itself in the glTF file before importing. Or one easy thing I’ve seen many glTF models do is create an empty root node that acts as an offset so you can easily translate the origin without editing all the geometry.

I’m using ION to convert COLLADA files to glTF, and don’t know the origin until loaded via ION. Is it possible to edit the glTF model once it’s in ION?

Thanks Omar.
