# \[Gltf\]: The model is spinning with out "orientation" section in czml.

**URL:** <https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031>\
**Category:** CesiumJS\
**Created:** [March 1, 2014, 9:16am UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031 "2014-03-01T09:16:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![researcher\_pim](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@researcher\_pim](https://community.cesium.com/u/researcher_pim)\
**Post date:** [March 1, 2014, 9:16am UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031/1 "2014-03-01T09:16:18Z")

</div>

Hi, All,

I create a czml by a .e file, which export from STK. No “orientation” section exists in this file. But when I load it into Cesium. And take the duck in Cesium Demo as model. I found the model is spinning. I put the czml as an attachment in this mail. After loading this czml, please speed up the timeline to 500X. Then you will see the spinning.

Thanks,

–Shawn

[battlefield.czml](https://community.cesium.com/uploads/short-url/wSNbMTQVsHBQtCe5sq9oVLnn1I8.czml) (329 KB)

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 1, 2014, 8:24pm UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031/2 "2014-03-01T20:24:04Z")

</div>

That’s because without orientation, it defaults to Quaternion.IDENTITY. You need to specify orientation in order to orient the model properly. Eventually we may support automatic orientation via velocity information,but that doesn’t exist yet. If you’re using STK, you can get that information by exporting a .a file.

---

<div class="post-metadata">

**Author:** ![shawngao5](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@shawngao5](https://community.cesium.com/u/shawngao5)\
**Post date:** [March 2, 2014, 3:22am UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031/3 "2014-03-02T03:22:22Z")

</div>

Hi, Matthew,  
Thanks for you reply. I ever tried convert a.file to orientation section. Seems the order of the number in each line of a file is different to the order of Czml. The python code snippet is used to convert a.file to orientation section. I tried all compound modes of this four numbers. Finally, I found [1,4,2,3] looks like the correct order. Even the [1,2,3,4] will cause the spinning. Is there any official definition of the Quaternion? What's the real mean of each number?

Thanks,  
Shawn

#python script convert .a file to orientation section:

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 6, 2014, 2:32pm UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031/4 "2014-03-06T14:32:25Z")

</div>

The order is a matter of convention. attitude files list orientation as W, X, Y, Z while Cesium (and most graphics applications in general) use X, Y, Z, Y.

I’m not very good at quaternions myself, I simply use other software to generate for me. The best I can offer you is a wikipedia link: [http://en.wikipedia.org/wiki/Quaternions\_and\_spatial\_rotation](http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation) There’s also other write-ups on various 3D developer related sites.

---

<div class="post-metadata">

**Author:** ![researcher\_pim](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@researcher\_pim](https://community.cesium.com/u/researcher_pim)\
**Post date:** [March 7, 2014, 12:57pm UTC](https://community.cesium.com/t/gltf-the-model-is-spinning-with-out-orientation-section-in-czml/1031/5 "2014-03-07T12:57:34Z")

</div>

Thanks for you replay. The order of Quaternions in Czml you just said is X, Y, Z, Y. I guess it's X, Y, Z, W. Am I right?
