Is there is a way to rotate the the 3d-tile model

My model is a little tilted. What can I do to correct it in cesium?
Can I rotate the model ?

Hi there,

Yes, you can control the tile orientation by modifying tileset.modelMatrix, like in this example that modifies the height translation:

Checkout this method also for creating the new model matrix:

Hope that helps,

  • Rachel

When I use the code below to test the rotation function, the 3dtiles model was disappeared ,and then I tested this in ,it's ok.
My 3dtiles Model was created by smart3d.

tileset.readyPromise.then(function (tileset) {
    var cartographic = Cesium.Cartographic.fromCartesian(;
    var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
    var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0);
    var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
    var v = [0.7, -0.7,0, 0.7,0.7, 0, 0, 0,1];
    var m = Cesium.Matrix3.fromArray(v);
    var rotationTranslationMatrix = Cesium.Matrix4.fromRotationTranslation(m, translation);
    tileset.modelMatrix =rotationTranslationMatrix;
}).otherwise(function (arg) {

Rotation is trickier to get right than translation when using the modelMatrix property. That is because many 3D Tiles models have their origin set to the Earth’s center and use the CESIUM_RTC glTF extension to place them on the globe.

So what happens when you rotate is:

To get the modelMatrix right it will first need to translate the opposite of the CESIUM_RTC value, then rotate, then translate back to the CESIUM_RTC value.

Or possibly your tileset is using a transform property in the root tile, in which case setting tileset._root.transform = rotationTranslationMatrix will solve it.

I’m not sure what your case is but I’d be happy to test this idea out further and provide some sample code if you are able to share the tileset.

thanks ,can i have you email address to send the tileset.


Hi Sean

I try to rotate the Tileset in Sandcastle, but failed. Here is my code.

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

shadows : false


viewer.scene.globe.depthTestAgainstTerrain = true;

var viewModel = {

height: 0



var toolbar = document.getElementById(‘toolbar’);

Cesium.knockout.applyBindings(viewModel, toolbar);

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

url : ‘…/…/…/Specs/Data/Cesium3DTiles/Tilesets/Tileset’


tileset.readyPromise.then(function() {

var boundingSphere = tileset.boundingSphere;, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius * 2));;

}).otherwise(function(error) {



//Cesium_RTC in one of the .b3dm

var cartesian = new Cesium.Cartesian3(1215020.301129722, -4736341.9686844405, 4081630.311150717);

Cesium.knockout.getObservable(viewModel, ‘height’).subscribe(function(height) {

height = Number(height);

if (isNaN(height)) {



var hpr2 = new Cesium.HeadingPitchRoll(height/100, 0, 0);

var rotation2 = Cesium.Matrix3.fromHeadingPitchRoll(hpr2);

var rotate = Cesium.Matrix4.fromRotationTranslation(rotation2, new Cesium.Cartesian3(0,0,0), new Cesium.Matrix4());

tileset.modelMatrix = rotate;//Cesium.Matrix4.multiply(tileset.modelMatrix, rotate, new Cesium.Matrix4());



This tileset is using Cesium_RTC.

I think I didn’t get the right rotation axis.

Can I get some help for rotating this sample tileset?



在 2017年7月12日星期三 UTC+8上午8:47:15,Sean Lilley写道:

The more I think about this, I realize it may hard to get right for a few different reasons involving how RTC and axis conversions are taking place in the Model code. So I don’t have a good solution for this yet.

Hi guo,
did u solve the problem?My model is tiled too.

Could u share the issue?

Thanks very much!

在 2017年7月10日星期一 UTC+8下午6:39:55,guojins…@gmail.com写道:

Ah I was trying to find this thread before responding to your post in!topic/cesium-dev/OES72vM5BlY. I’m also curious to know if anyone has solved this.