camera.lookAt(position, heading, tilt, range) (moving from Google Earth to Cesium)


Our GE code mostly controls the camera as “lookAt”.

How to do the same in Cesium?

Ideally, I’m looking for something like

camera.lookAt({ position: …, heading: …, tilt: …, range: … })

Will 1.6 help?

(I’ve spent hours until found out how to use quaternions to orient models. Than found that 1.6 brings clear interface for that. Trying to avoid the same for camera.)

Or should I just continue playing with EntityView code and ask specific questions?

Thank you.

It appears that Cesium’s 1.6 lookAt will act the same as Google Earth’s lookAt

Unless I’m mistaken it appears that Google Earth’s lookAt is limited to targets on the planet’s surface. After reading the code it seems that Cesium does not have this limitation as it uses Matrix4 which retains both 3D position and rotation information for a reference frame.

Hyper Sonic is correct, 1.6 has major camera improvements that should be more familiar to GE developers. Cesium also has no limitations on what you look at like Google Earth does, so you can easily look off-earth or track an object in air or space. 1.6 is due out on Monday.

I’m glad I’m not mistaken! This will allow one to easily follow aircrafts and spacecrafts while retaining a Earth relative camera orientation. Also using heading,tilt,range (=polar) is one option. Internally this is converted to a Cartesian offset. You could alternatively set the offset using Cartesian ordinates directly it seems.

In 1.6, you’ll be able to do this:

camera.lookAt(position, new HeadingPitchRange(heading, pitch, range));

I posted the details of what will be in version 1.6 here:!topic/cesium-dev/2-Fn_8yeurY