I'm getting closer to my camera code

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);

 }

Bob, I’m not much of a camera guy, but I just wanted to add that Cesium is still in beta and one of the things we definitely want to do before “1.0” is improve the level of abstraction for the camera API.

For your other concerns:

Everything is in radians and meters unless it’s explicitly specified. For example Cartographic.fromDegrees takes degrees.

Cartographic and Geographic are the same thing, but as previously mentioned Cesium is going to want them in radians and meters.

We have a slowly growing set of tutorials on the website: http://cesium.agi.com/tutorials.html Cesium Up and Running should handle some of your questions, and the Camera tutorial wil hopefully answer others.

The reference documentation is here: http://cesium.agi.com/refdoc.html and is also included in the Documentation directory with each release.

Plenty of us also use Visual Studio, there’s absolutely no requirement to use Eclipse. The reason Eclipse is the “default” is simply because it’s free and open source, just like Cesium.

Knowledge of HTML, JavaScript, and CSS are all that’s really needed to use Cesium. However, if you are going to do lower-level things, then certainly 3D knowledge is a big plus. We have a recommended reading section on our wiki that you might be interested in https://github.com/AnalyticalGraphicsInc/cesium/wiki/Recommended-Reading

I hope that helps.