CZML not loading with embedded gITF

I created a CZML which also includes orientation data and an embedded gITF but it hangs when dragged into the Cesium Viewer. If I remove the model section or the orientation section the file loads fine. The file is almost 5 MB which I didn't think would be a problem. Any ideas what may be happening?

CZML attached

test1.czml (4.96 MB)

Your orientation property is missing the required “interpolationDegree” property. What tool did you use to create this file?

Ah ok, I was using the czml-writer

Now its giving the following error:

An error occurred while rendering. Rendering has stopped.

This may indicate an incompatibility with your hardware or web browser, or it may indicate a bug in the application. Visit http://get.webgl.org to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:

RangeError: Invalid array length
RangeError: Invalid array length
at Q (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:391:8436)
at $ (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:391:10326)
at dt (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:391:15171)
at pt.render (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:391:20609)
at M.render (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:392:30591)
at t (http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/CesiumViewerStartup.js:392:13496)

test2.czml (4.96 MB)

It looks like the problem stems from precision issues in your unit quaternion samples. orientation is interpolated by converting the unit quaternions to axis-angle representation, which is producing NaNs when it ends up taking the sqrt of a negative number. Those NaNs end up spreading everywhere throughout the system, causing a crash in the frustum code.

I’m a bit out of my element with the quaternions, but I think this stems from your samples not actually being unit quaternions. For example, the first sample in the file:

Quaternion.magnitude(Quaternion.unpack([0.360254,0.216623,-0.275734,0.864444]))

1.0000005682683386

Arguably, the CZML loading code should automatically normalize unit values when loading them from CZML. This would apply to unit cartesians and unit sphericals as well.

Thanks for the help! Once I normalized all the quaternions it worked fine. I was having issues with the order of the UnitQuaternion as well because I thought the order was W,X,Y,Z but it is actually X,Y,Z,W in the Earth Fixed frame.