Move Camera to Look down the line between 2 entities

1. A concise explanation of the problem you’re experiencing.

I’m trying to get the Cesium Camera to fly to a direction at the current Cesium Camera height behind an entity billboard(in this case a satellite in the sky) and adjust the camera heading, pitch and roll to have the camera looking at the entity directly behind looking down at a footprint entity at the ground. This position is not usually directly beneath the space entity and projected at an angle on the Earth from it. I don’t want to lookAt or get the camera locked on to the entity, just simply move to that pointing position. I feel like there should be an easy way to do this, but despite my best efforts I can’t seem to get it to work.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

No code of getting it to work, however i would have 2 entities with Cesium.Cartesian3(0, 0, 2000)satellite and Cesium.Cartesian3(1.5, 1.5,0)ground entity

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

User requirement

4. The Cesium version you’re using, your operating system and browser.

Using Cesium 1.58.1, Windows 10, and Chrome

On mobile at the moment but I believe we just recently did something similar.

If you know the direction you are looking use Camera.setView(…)

Combine this with the frustum properties to adjust the actual field of view (as opposed to the default zoom which is actually a dolly).

  • jk

Thanks for the reply James. However, I won’t know what the direction is ever facing. I’m fed the 2 different points from a database and they could be in any which direction from each other. The only constant is that one is in space, and the other one is on the Earth. I need to be able to calculate the camera to move to satellite and be facing down the satellite billboard with the earth point directly behind that. (like looking down from the point to that point on the Earth basically)

This has been a requested feature for a while, see this GitHub issue which has some sample code which may be helpful: