Hi,
We have panoramic photos taken at specific places with special 360 degree cameras, and we would like to display them. At the same time the photos are taken a lidar scanner also captures a pointcloud, that is spatially aligned with the photos.
So I converted the pointcloud to 3DTiles and have it displaying without problem. Then I converted the panorama photos into the Skybox (cube) format. These skyboxes are displaying, and the 6 faces are aligned without seams.
But the problem we face is that the Skybox assumes the photo axis are True Equator Mean Equinox (TEME). Our skyboxes have a well-known East-North-Up orientation at the place they were taken.
Is there any way to change the model transformation of the Skybox draw commands to insert another (non-identity) transformation, or have it default to ECF axis for example? Thanks
This is the sandcastle code we are running:
const viewer = new Cesium.Viewer("cesiumContainer");
viewer.scene.terrainProvider = false;
viewer.scene.skyBox = new Cesium.SkyBox({
sources : {
positiveX : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_E.jpg',
negativeX : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_W.jpg',
positiveY : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_N.jpg',
negativeY : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_S.jpg',
positiveZ : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_U.jpg',
negativeZ : 'http://localhost:8080/cesium/mapping_run/lokeren/panorama1/cubic12/LB_5000110_D.jpg'
}
});
console.log(viewer.scene.skyBox._command.modelMatrix);
const pointCloudTileset = await Cesium.Cesium3DTileset.fromUrl("http://localhost:8080/cesium/mapping_run/lokeren/pointcloud/tileset.json");
viewer.scene.primitives.add(pointCloudTileset);
pointCloudTileset.style = new Cesium.Cesium3DTileStyle({color: "color('yellow')"});
viewer.scene.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(4.011298194414697, 51.087711880147907, 49.831666971488410),
orientation: new Cesium.HeadingPitchRoll(0.0,0.0,0.0)
});
and a screenshot of the result:
Edited for code formattng
Hi @lerzeel2,
Thanks for your post.
As a workaround, we should be able to override the ECEF to TEME transformation to the identity matrix, as in this Sandcastle example. This should render the skybox in with axes defined in ECEF instead of TEME.
Additionally Transforms.eastNorthUpToFixedFrame
could be used in that override function to use ENU instead of ECEF.
Please let us know if that works for you and if you have further questions.
1 Like
Hi Luke,
Thanks for your advice. It just made not my day, not my week, but my month! 
This did the trick:
Cesium.Transforms.computeTemeToPseudoFixedMatrix = (time, result) => Cesium.Matrix4.getMatrix3(Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(4.011298194414697, 51.087711880147907, 49.831666971488410), Cesium.Ellipsoid.default), result);
And this is the result:
2 Likes