I need a Cesium starting push

I’m new to Cesium and even newer to JavaScript so bear with me. I have migrated from OpenGlobe to Cesium and have a few questions. Also, I’m no mathematician, so some things may be obvious to you but are vague to me. I’m new to web development. I do however have many years of 3D graphics programming experience and understand it very well:

· Where do I point my javascript src to:

o

o

· Are Cartographic coordinates synonymous with OpenGlobe Geographic coordinates?

· Some of the HTML API docs do not specify degrees or radians as the parameters to some methods. Is there a hard and fast rule when to use which?

· Camera.controller.lookAt(eye, target, up) seems very straight forward. Eye is the position of the camera, target is where you want to look, up is the up axis. Are these Cartesian3 vectors in degrees or radians?

· I’m using a CesiumTerrainProvider and am trying to place the camera thus:

controller.setPositionCartographic(new Cesium.Cartographic.fromDegrees(

-122.377337,

37.605126,

150.0));

 target = new Cesium.Cartesian3(new Cesium.Cartographic.fromDegrees(

-122.357164,

37.611342,

100.0));

controller.lookAt(camera.position, target, Cesium.Cartesian3.UNIT_Z);

But this does not work. I also see sample code like this (from the Camera tutorial):

camera.controller.lookAt(

new Cesium.Cartesian3(120000.0, 120000.0, 120000.0),

Cesium.Cartesian3.ZERO,

Cesium.Cartesian3.UNIT_Z);

… which makes no sense to me. How can these vectors be radians or degrees?

I just want to initially learn how to control the darn camera. I’m assuming that Cesium.Viewer has fov, near and far plane defaults.

· I don’t expect anyone to just give me the code. I would rather someone point me to some docs or examples that I can learn from.

· Having absolutely no HTML/JavaScript experience, are there other aspects of developing a web app with Cesium that I need to spin up on first (besides HTML and JavaScript J )?

· Finally, I use Visual Studio Pro and/or Expression Blend for my dev environment. I pay $$$ every year for it so I’m not going to use Eclipse. But this shouldn’t be a problem, OR IS IT!?

· Is there a suggested Visual Studio template I should start with when developing a Cesium app?

PLEASE, someone point me in the right “getting started” direction.

Thanks in advance!

Bob Smith

Columbia, MD.

Hi Bob,

I can answer some of your questions:

· Are Cartographic coordinates synonymous with OpenGlobe Geographic coordinates?

The Cartographic type is synonymous with the Geodetic2D and Geodetic3D types from OpenGlobe.

· Some of the HTML API docs do not specify degrees or radians as the parameters to some methods. Is there a hard and fast rule when to use which?

If the documentation does not state otherwise, the units are generally in radians for Cartographics/angles and meters for the Cartesian types.

· Camera.controller.lookAt(eye, target, up) seems very straight forward. Eye is the position of the camera, target is where you want to look, up is the up axis. Are these Cartesian3 vectors in degrees or radians?

Cartesian3 is synonymouse with the Vector3[DFHI] types in OpenGlobe. When used with the camera functions, the units are meters.

· I’m using a CesiumTerrainProvider and am trying to place the camera thus:

controller.setPositionCartographic(new Cesium.Cartographic.fromDegrees(

          -122.377337,

          37.605126,

          150.0));

 target = new Cesium.Cartesian3(new Cesium.Cartographic.fromDegrees(

       -122.357164,

       37.611342,

       100.0));

controller.lookAt(camera.position, target, Cesium.Cartesian3.UNIT_Z);

But this does not work. I also see sample code like this (from the Camera tutorial):

camera.controller.lookAt(

new Cesium.Cartesian3(120000.0, 120000.0, 120000.0),

Cesium.Cartesian3.ZERO,

Cesium.Cartesian3.UNIT_Z);

… which makes no sense to me. How can these vectors be radians or degrees?

I just want to initially learn how to control the darn camera. I’m assuming that Cesium.Viewer has fov, near and far plane defaults.

You do not need to use the “new” keyword when using Cartographic.fromDegrees. It returns a new Cartographic object. There is no Cartesian3 constructor that takes a Cartographic parameter. To convert a Cartographic to a Cartesian3, see Ellipsoid.cartographicToCartesian.

Regards,

Dan