잘 써오던 코드 (1.45 버전)
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({uri: '/data/tileset.json',
maximumMemoryUsage : 768,
skipLevelOfDetail : false,
baseScreenSpaceError : 1024,
skipScreenSpaceErrorFactor : 16,
skipLevels : 1,
immediatelyLoadDesiredLevelOfDetail : false,
loadSiblings : false,
cullWithChildrenBounds : true
}));
tileset.readyPromise.then(function(tileset) {
var heightOffset = 28; //타일 고도 : 지형이 있을때
var boundingSphere = tileset.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
tileset.show = true; //모델 보이기
});
수정해서 성공한 코드 (1.50 버전)
var tileset = new Cesium.Cesium3DTileset({url: '/data/tileset.json',
maximumMemoryUsage : 768,
skipLevelOfDetail : false,
baseScreenSpaceError : 1024,
skipScreenSpaceErrorFactor : 16,
skipLevels : 1,
immediatelyLoadDesiredLevelOfDetail : false,
loadSiblings : false,
cullWithChildrenBounds : true
});
viewer.scene.primitives.add(tileset);
tileset.readyPromise.then(function(tileset) {
var heightOffset = 28; //타일 고도 : 지형이 있을때
var boundingSphere = tileset.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
tileset.show = true; //모델 보이기
});