We’re working on some tools for recording video from Cesium. We currently have a lot of hack-y infrastructure for pausing and resuming a flyTo (and an associated screen capture) while content loads within the default render loop. Unfortunately we (a) don’t have exact control over the timeline, (b) occasionally get off-by-one errors where content notifies us that it has finished loading, but does not appear in the immediately following frame when we unpause, and © have to use a 1/6 framerate multiplier to get an acceptable framerate in the output video, because Cesium can’t keep up with the target framerate.
We’re thinking of adding the ability to capture a 360 cubemap into our tools, which means we will need to capture 6 views-per-frame at exactly the same time-step, and at this point it seems better that we just start from scratch and write our own render loop to take exact control over the camera view, timestepping, and interleaving of content loading with renders. Is there an example, or documentation, showing all of the events/callbacks we need to fire off to update the clocks for the scene and the camera tweening, as well as to do our own checks of whether all of the content in a scene is ready to be rendered?
I’ve been digging around in the source code and it looks like this functionality is spread out all over the place.
For example https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js has an onTimelineScrubFunction, but the clock being manipulated is not a member of that Viewer object (and as far as I can tell none of the Viewer, Scene, or CesiumWidgets take an explicit clock argument to their constructors).
Similarly, startRenderLoop in https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/CesiumWidget/CesiumWidget.js has a lastFrameTime local variable, which appears to track the (real-world) time since the last frame, but doesn’t appear to influence the simulation time at all.