Hi Sean,
I have tried your suggestion using the below code,but the models disappeared.
Could u help to point out my code mistake?
Thanks very much!
tileset.readyPromise.then(function(tileset) {
// Set the camera to view the newly added tileset
//viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, 30, 3000));
var heading = Cesium.Math.toRadians(0);
var pitch = Cesium.Math.toRadians(10);
var roll = Cesium.Math.toRadians(0);
var boundingSphere = tileset.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var rotation = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(20.0));
var offset = new Cesium.Cartesian3(0,0,0);
//var translation = Cesium.Cartesian3.subtract(offset, boundingSphere.center, new Cesium.Cartesian3());
var modelMatrix = new Cesium.Matrix4();
var headingPitchRoll = new Cesium.HeadingPitchRoll(heading,pitch,roll);
//Cesium.Transforms.headingPitchRollToFixedFrame(new Cesium.Cartesian3(0,0,0), headingPitchRoll, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, modelMatrix);
Cesium.Transforms.headingPitchRollToFixedFrame(boundingSphere.center, headingPitchRoll, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, modelMatrix);
//tileset.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation);
//tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
tileset.modelMatrix = modelMatrix;
});
在 2017年12月7日星期四 UTC+8上午8:08:45,Sean Lilley写道: