Here is the code of the modified Cesium Viewer Widget Sandcastle example that rotates the camera:
require([
'Cesium', 'Widgets/Dojo/CesiumViewerWidget', 'dojo/io-query'
], function(
Cesium, CesiumViewerWidget, ioQuery) {
"use strict";
// Parse URL configuration options into endUserOptions
var endUserOptions = {};
if (window.location.search) {
endUserOptions = ioQuery.queryToObject(window.location.search.substring(1));
}
// Initialize a viewer capable of drag-and-drop
// and user customizations.
var widget = new CesiumViewerWidget({
endUserOptions : endUserOptions,
enableDragDrop : true
});
widget.placeAt('cesiumContainer');
widget.autoStartRenderLoop = false;
widget.startup();
function updateAndRender() {
widget.initializeFrame();
var time = widget.update();
widget.scene.getCamera().controller.rotateRight(0.001);
widget.render(time);
Cesium.requestAnimationFrame(updateAndRender);
}
Cesium.requestAnimationFrame(updateAndRender);
Sandcastle.finishedLoading();
});