b28: DynamicObjectView behavior (not using Viewer)


I have tried many things to try and get around a problem I am having with tracking a DynamicObject using the DynamicObjectView functionality; note that I am using b28 and not using the Cesium Viewer widget.

Specifically, I’m finding that the camera zooms too far along the Z-axis once the DynamicObjectView.update is first called. The user has to then zoom out and “twist/rotate” the camera to find the newly tracked object. The update() portion of the DynamicObjectView is working as expected and beats having to update the camera position with each tick; however, the initial zoom is not acting as desired. X and Y position elements may also be slightly off but Z-axis is the main issue.

I’ve developed a several theories while working on this issue but have not been able to prove/disprove any of them.

  1. The zoom is moving to the position of DynamicObject’s first time block (i.e. availability start/end) and not the position based on the clock’s current time.

  2. The DynamicObject simply has the wrong position; or the position for the current time is somehow off from Ceisum’s internal clock.

  3. Our setting of farToNear ratio of 100 is not a good practice; but changing this value does not seem to help.

  4. Something else is happening in the Viewer widget that I am not accounting for…

Other information:

  1. Issue occurs with billboards and models.

  2. When setting up the DynamicObjectView object I have tried using UNIT_SPHERE and the Globe as the ellipsoid.

  3. I see the same behavior regardless of whether the DynamicObject is:

a) Picked from the Scene

b) Fetched from a list of our locally managed DynamicObjects

c) Created on the fly using the position information as provided from the selected object on the Scene.

I don’t have any source code to provide at this moment but I wonder if anyone might arrive at some conclusions based on the information I’ve provided above.

Thanks for your help!

Nothing special should be required. Have a loot at the implementation used by Viewer: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/viewerEntityMixin.js

All you should have to do is construct it with

var entityView = new EntityView(value, scene, globe.ellipsoid);

and then you call update every frame.

if (defined(entityView)) {



The trick here is that you need to call update at the correct time (scene.initializeFrame but before scene.render) The clock.onTick callback is the ideal place to do that and may be what you are missing.

If you are still having problems, please post a small example showing the problem. Thanks.