Daniel,
I finally got something working. The code is below. Please have a look at it. It seems to me that Cesium would have abstracted away the need to set the camera.right and camera.up vectors.
· Is there an easier way to do this?
· I don’t see a Cesium camera that provides “target tracking” or a “Free movement” camera that uses yaw, pitch and roll. Are these in there somewhere?
· One last question then I’ll go away J. Some of the Cesium examples/tutorials point to Cesium/Source for all of the JavaScript files, but when I do nothing works. I’m pointing at Cesium/Build/Cesium which works but was missing some directories in the b18 release (and Cesium/Source/Cesium.js doesn’t look anything like Cesium/Build/Cesium/Cesium.js which appears to be obfuscated).
o What is the correct way of pointing to which source?
Thanks again!
Bob
Here is the source I used that positions my camera but I gotta’ believe there is an easier way (I’m using a Cesium.Viewer with a Cesium.EllipsoidTerrainProvider:
function positionCamera() {
var camera = scene.getCamera();
var cameraCartographic = Cesium.Cartographic.fromDegrees(-122.375597, 37.618923, 300.0);
var targetCartographic = Cesium.Cartographic.fromDegrees(-122.357164, 37.611342, 20.0);
var target = Cesium.Ellipsoid.WGS84.cartographicToCartesian(targetCartographic)
var right = new Cesium.Cartesian3.cross(
target,
new Cesium.Cartesian3(0.0000291369789812141, 0.0000291369789812141, 0.0000291369789812141));
var up = new Cesium.Cartesian3.cross(target, right);
camera.controller.lookAt(
Cesium.Ellipsoid.WGS84.cartographicToCartesian(cameraCartographic),
Cesium.Ellipsoid.WGS84.cartographicToCartesian(targetCartographic),
up);
}