1. A concise explanation of the problem you’re experiencing.
I have some point cloud data displaying in Cesium which I am now trying to place in its real world location, but trying to centre the Cesium viewer on that location doesn’t seem to be working in terms of setting the right location.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
animation: false,
terrainProvider: Cesium.createWorldTerrain(),
timeline: false
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : ‘http://127.0.0.1:8081/cesium/test/tileset.json’
}));
viewer.camera.setView({
destination : Cesium.Cartesian3.fromDegrees(
lng,
lat,
Cesium.Ellipsoid.WGS84.cartesianToCartographic(viewer.camera.position).height
)
});
// also tried
var center = Cesium.Cartesian3.fromDegrees(
lng,
lat,
Cesium.Ellipsoid.WGS84.cartesianToCartographic(viewer.camera.position).height
);
viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, 0.0, 0.0));
viewer.zoomTo(tileset);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I am displaying point cloud data converted to 3D tiles using entwine.io. The data is showing fine, but the location it is set to on the globe seems to be deep under the Pacific ocean instead of where I’d like it to be, I am aiming to display the data where it actually is in the real world using a set of lat/lng coordinate (or any other kind that can be determined).
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.61 on OS X using Chrome 76.
Thanks,
Martin