get world coordinates from camera settings


I’m storing the camera settings in variable as follow:

    var camera = $;
    var store = {
      position: camera.position.clone(),
      direction: camera.direction.clone(),
      up: camera.up.clone(),
      right: camera.right.clone(),
      transform: camera.transform.clone(),
      frustum: camera.frustum.clone()

source: [1]

I was wondering how to get the “look-at” position of the camera (the longitude and latitude values of the point observed in the center of the camera view)

I was trying with:

Cesium.Cartographic.fromCartesian(‌​d(camera.position.clo‌​ne().x, camera.position.clone().y))

but that doesn’t work of course … the position of the camera is not where I’m looking at …

Have you any clue on how to accomplish that?




Hello Massimo,

If you save the values you’ve listed above, you should get the same camera view if you set those values later on. Why do you need the look at position?


Hi hammah, I need the coordinates so that I can use them in a query to a post gis database

Ah okay. The best way I can think to do this would be to pick the center of the screen by doing something like this:

Cesium.Cartographic.fromCartesian(‌​d(scene.canvas.clientWidth/2, scene.canvas.clientHeight/2));