3dtiles is a little bit inclined,How to modify in the code?

1. A concise explanation of the problem you're experiencing.

3dtiles is a little bit inclined, I want to change the angle of the 3dtiles

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(121.6184585, 31.1288196, -18.99991009), 560.7095979);
         var Sunkingtileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
             url: './3dtiles/Qinxi/3DTiles.json',
             maximumScreenSpaceError : 1,
             maximumNumberOfLoadedTiles : 1000
   }));

         Sunkingtileset.readyPromise.then(function (Sunkingtileset) {
               var cartographic = Cesium.Cartographic.fromCartesian(Sunkingtileset.boundingSphere.center);
               var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
               var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 20);
               var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
               viewer.camera.flyToBoundingSphere(boundingSphere, {duration: 3});
               Sunkingtileset.modelMatrix = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45)), translation);
         });

As shown in the code, I want to turn the 3dtiles model to 45 degrees in the Z axis but not in effect

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

Because my 3dtiles model has a little bit of tilt

4. The Cesium version you're using, your operating system and browser.

1.41 Chrome

If the modelMatrix is the identity, you may need to apply the rotation to the root tile, like so:

var matrix = tileset._root.transform;
var rotation = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45));
Cesium.Matrix4.multiplyByMatrix3(matrix, rotation, matrix);

``

Here’s an example with it working in Sandcastle.

Thanks,

Gabby

If the tileset uses the CESIUM_RTC extension setting the rotation may not work because of the interaction between the RTC and model matrix. This affects tilesets produced by ContextCapture. Could you send over the tileset?