How to set 3D model scale like Google earth in czml


We are using cesium to migrate from google earth.I am able to render 3D models by using gltf file. I need help in setting scale and orientation properties for 3D models since in GE for scale we need to set scaleX,scaleY and scaleZ.


Hello Gayatri,

Have you seen this demo? :

You can set the orientation using the Model orientation argument. This demo shows you how to create an orientation from heading/pitch/roll.

If scaleX, scaleY and scaleZ all have the same value, you can use the model.scale argument to do a uniform scale on the model. If not, you’ll need to use a modelMatrix to do the non-uniform scale which will be a little more complicated. If that’s the case, let me know and I can write a demo to show you how to do this.




Actually, I just found out that it is not currently possible to do a non-uniform scale using CZML or entities. I’ve created an issue here:

Meanwhile, if you don’t need to use the entities layer, you can do a non-uniform scale on a model using a model matrix. Here’s an example that I modified from from the development/3D models sandcastle example

function createModel(url, height, heading, pitch, roll) {

var origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);

var modelMatrix = Cesium.Matrix4.multiply(

Cesium.Transforms.headingPitchRollToFixedFrame(origin, heading, pitch, roll),

Cesium.Matrix4.fromScale(new Cesium.Cartesian3(1.0, 2.0, 3.0)), //Apply non-uniform scale of scaleX=1, scaleY=2, scaleZ=3

new Cesium.Matrix4());

scene.primitives.removeAll(); // Remove previous model

var model = scene.primitives.add(Cesium.Model.fromGltf({

url : url,

modelMatrix : modelMatrix,

minimumPixelSize : 128


model.readyPromise.then(function(model) {

// Play and loop all animations at half-speed


speedup : 0.5,

loop : Cesium.ModelAnimationLoop.REPEAT


var camera =;

// Zoom to model

var controller = scene.screenSpaceCameraController;

var r = 2.0 * Math.max(model.boundingSphere.radius, camera.frustum.near);

controller.minimumZoomDistance = r * 0.5;

var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix,, new Cesium.Cartesian3());

var heading = Cesium.Math.toRadians(230.0);

var pitch = Cesium.Math.toRadians(-20.0);

camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, r * 2.0));