How to rectify the angle of slope of oblique photograph 3dtiles generated by ContentCapure?

When I generated 3dtiles using ContentCapture and loaded the tile files into my web application,I found the models having some angle of slope,like this:

There are My code:

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url: ‘…/SceneHuzhou/Production_2.json’,

//url:’…/Scene/Scene-20170715-120-123/tileset.json’,

maximumScreenSpaceError : isMobile.any() ? 8 : 1, // Temporary workaround for low memory mobile devices - Increase maximum error to 8.

maximumNumberOfLoadedTiles : isMobile.any() ? 10 : 1000 // Temporary workaround for low memory mobile devices - Decrease (disable) tile cache.

}));

How can I rectify the angle of slope?

Any helped would be greatly appreciated, thanks.

I tried the code:
var rotation = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(20.0));

tileset.modelMatrix = Cesium.Matrix4.fromRotationTranslation(rotation);

But it dosn’t work?
在 2017年12月6日星期三 UTC+8下午6:50:09,xuzhit…@163.com写道:

This case is a bit tricky to solve. The model matrix does not rotate the tileset relative to its local reference frame, but instead rotates the tileset in Cartesian space where the Earth’s center is (0,0,0). What happens then is the rotation works but isn’t really what you’d want: screenshot attached.

You could try applying a model matrix that, in sequence,

  1. translates the tileset to (0,0,0) using the tileset’s bounding sphere center as the tileset’s position

  2. apply a rotation like you have

  3. translate the tileset back to its original position

I haven’t tested this idea out though, so it might not work.

One thing that makes this difficult is ContextCapture usually saves tiles with the CESIUM_RTC extension, which makes it harder to edit the transform later. Tilesets with a tileset transform are much easier to manipulate.

rotation.png

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写道:

I tried a few different approaches but didn’t have any luck either. The CESIUM_RTC extension really complicates things.

oh…
So I have to try retaking the photo,thanks a lot!

在 2017年12月8日星期五 UTC+8上午9:29:45,Sean Lilley写道: