CameraFlightPath.createAnimationCartographic problem positioning the camera...

Hi to all,

First of all, congrats to entire Cesium’s team. I’m new on Cesium. It is really great. Powerful 3D visualization in your web browser without installing anything!!!

I’m programming a 3D viewer and I want to perform some flights and animations between different camera positions.

What is the equivalence between

createAnimationCartographic **destination, direction and up **


lookat eye, target and up ???

destination <-> eye

direction <-> target

**up <-> up **


I tried with these equivalences but, the result that works OK in lookat, fails (bad camera orientation, 2D positioning ok) in createAnimationCartographic.

Any hints???

Thanks in advance!

The direction is a unit vector in the direction you want the camera to look. Target is the actual position being looked at. The mapping would then be:

destination <-> eye

up <-> up

direction <-> target.subtract(eye).normalize()

Also, since eye and target are cartesians, you can use createAnimation instead of createAnimationCartographic.

Thanks Daniel!

I tried to do that

Target is a Cartesian3. Eye is a Cartesian3.

target.subtract(eye) works well, but when I tried to aply normalize method I obtain this error:

Uncaught TypeError: Object function (e){return i.normalize(this,e)} has no method ‘cross’

Refering to javascript code of Cesium:


I verified that Cesium is correctly installed and setup (following website instructions, webserver is Apache)

Any hint???

Many thanks in advance again!

Can you copy/paste your code? I think you may have forgotten to put parentheses after the call to normalize.


Thanks Scott.
Thanks Daniel.

I have to normalize also the up vector.

Now it works well!

However I detect that the fly is not smooth… I mean: If I am in a position near to the one I want to flight, the path of the flight is not the shortest, also the flight movement includes some rare twists… I don’t know if this is the normal behavior or there is something that I am not doing right…

Thanks again!