(b28) Morphing to 2D throwing an error; 'near' is NaN


We haven’t had an issue with morphing between 3D, 2D, and 2.5 for some time. For some reason now, after upgrading to b28 (though not ruling out that we are doin somethin wronng), the morph is failing due to an “invalid array length” within updateFrustrums().

Specifically, it seems that the last DrawCommand is providing a radius of NaN, thereby producing a ‘near’ value of NaN within "createPotentiallyVisibleSelects(); ‘near’ is then passed into updateFrustrums() from an “invalid array length” is thrown.

Any ideas on why this might be happening? Anyone run across this before?


Chris - can you consistently reproduce this? If so, can you provide a minimal test case for us to debug?



Hi Patrick,

Yes, unfortunately it’s happening each time. I plan to try morphing without any objects loaded tomorrow and will let you know. Recreating a test case might be a bit difficult.

I will say that - after my initial post - I dug into the issue a bit further; the last DrawCommand in the morph sequence has a ‘BoundingVolume’ attribute. The radius provided in this last object is NaN. When updateFrustums is called, the function loops through the DrawCommands and computes near, far, and ratio values. On this last DrawCommand Cesium fails to handle the NaN case and more or less stops running. Cesium becomes unresponsive.

Does this help any?

Will try to get a test case to you tomorrow. Thank you.

  • Chris

Hi Chris,

DrawCommand has an “owner” property that will tell you who (what primitive or what terrain tile) created the command. If you can tell us the type of object that created the command, it should narrow things down quite a bit.


Kevin - Awesome, I’ll look into this first thing and let you know. Thank you!