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 (329 KB)
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.
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:
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 There’s also other write-ups on various 3D developer related sites.
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?