Skip to content

Commit

Permalink
#9163 Bug 3D Tiles offset with Google 3D tiles (#9421)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudadel54 authored Sep 11, 2023
1 parent f44489d commit b6506f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/client/components/map/cesium/plugins/ThreeDTilesLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ function getStyle({ style }) {
function updateModelMatrix(tileSet, { heightOffset }) {
if (!isNaN(heightOffset) && isNumber(heightOffset)) {
const boundingSphere = tileSet.boundingSphere;
const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); // undefined if the cartesian is at the center of the ellipsoid
const surface = Cesium.Cartesian3.fromRadians(cartographic?.longitude || 0, cartographic?.latitude || 0, 0.0);
const offset = Cesium.Cartesian3.fromRadians(cartographic?.longitude || 0, cartographic?.latitude || 0, heightOffset);
const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileSet.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
}
Expand Down

0 comments on commit b6506f3

Please sign in to comment.