# Model is always upside down.

**URL:** <https://community.cesium.com/t/model-is-always-upside-down/5345>\
**Category:** CesiumJS\
**Created:** [March 29, 2017, 5:45am UTC](https://community.cesium.com/t/model-is-always-upside-down/5345 "2017-03-29T05:45:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Giana](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Marco\_Giana](https://community.cesium.com/u/Marco_Giana)\
**Post date:** [March 29, 2017, 5:45am UTC](https://community.cesium.com/t/model-is-always-upside-down/5345/1 "2017-03-29T05:45:28Z")

</div>

Hi,

I have seen this discussed a number of places and tried everything but I am still not having success. This is what I have done

1. Down loaded Cesium-1.31 from [http://cesiumjs.org/downloads.html](http://cesiumjs.org/downloads.html) and it works great.
2. Downloaded a model [https://3dwarehouse.sketchup.com/model/2ac1d07d86aa7fdc45e81db730974dc/Sydney-Opera-House](https://3dwarehouse.sketchup.com/model/2ac1d07d86aa7fdc45e81db730974dc/Sydney-Opera-House)
3. Opened in Sketchup and exported as COLLADA file, which is attached in Sydney\_Opera\_House\_DAE.zip
4. I downloaded collada2gltf.exe from [https://github.com/AnalyticalGraphicsInc/collada2gltf-web-service/blob/master/collada2gltf/win32/collada2gltf.exe](https://github.com/AnalyticalGraphicsInc/collada2gltf-web-service/blob/master/collada2gltf/win32/collada2gltf.exe)
5. I ran collada2gltf.exe -f Sydney\_Opera\_House.dae which created my model which is attached as Model.zip.
6. I created a Model directory where I have CesiumJS installed and placed my model there.
7. In Sandcastle I tried the following  
var viewer = new Cesium.Viewer(‘cesiumContainer’);  
var origin = Cesium.Cartesian3.fromDegrees(151.21499, -33.85667, 0);  
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);  
var entity = viewer.entities.add({  
position : origin,  
model : {  
modelMatrix: modelMatrix,  
uri : ‘/Cesium-1.31/Model/Sydney\_Opera\_House.gltf’,  
}  
});

var heading = Cesium.Math.toRadians(90);  
var pitch = Cesium.Math.toRadians(-30);  
viewer.zoomTo(entity, new Cesium.HeadingPitchRange(heading, pitch));  
But the model is always rendered upside down as shown in UpsidedownModel.PNG.

I have tried not setting the modelMatrix, and have tried all the Cesium.Transforms options but nothing corrects the models orientation.

Any points on what I am doing wrong?

Regards

Marco

[Model.zip](https://community.cesium.com/uploads/short-url/rqIcJKPBhByhV5tzQc2ITGPS88X.zip) (294 KB)

[Sydney\_Opera\_House\_DAE.zip](https://community.cesium.com/uploads/short-url/gf0i2zeODehbL6NTyReH12W2l9i.zip) (374 KB)

 ![UpsidedownModel.PNG.jpg](https://global.discourse-cdn.com/cesium/original/1X/791f109325eceaab2aded245a40d3ea45ba95989.jpeg)

---

<div class="post-metadata">

**Author:** ![Willem](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@Willem](https://community.cesium.com/u/Willem)\
**Post date:** [March 29, 2017, 11:19am UTC](https://community.cesium.com/t/model-is-always-upside-down/5345/2 "2017-03-29T11:19:36Z")

</div>

Hi Marco,

The way we orient models is by using an orientation, so the code would be something like this (did not test it).

var viewer = new Cesium.Viewer(‘cesiumContainer’);  
var origin = Cesium.Cartesian3.fromDegrees(151.21499, -33.85667, 0);  
// var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);  
var hpr = new Cesium.HeadingPitchRoll(0.0, 0.0, 0.0);  
var orientation = Cesium.Transforms.headingPitchRollQuaternion(origin, hpr); // todo will be modified in 1.33.  
var entity = viewer.entities.add({  
position : origin,  
orientation: orientation,  
model : {  
uri : ‘/Cesium-1.31/Model/Sydney\_Opera\_House.gltf’,  
}  
});

``

In case the model is still upside-down you could try changing the HeadingPitchRoll() values.

Regards, Willem

---

<div class="post-metadata">

**Author:** ![Marco\_Giana](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Marco\_Giana](https://community.cesium.com/u/Marco_Giana)\
**Post date:** [March 29, 2017, 1:28pm UTC](https://community.cesium.com/t/model-is-always-upside-down/5345/3 "2017-03-29T13:28:53Z")

</div>

Hi Willem,

thank you very much for the information. I got it going with the following adjustment to the HeadingPitchRoll as you suggested

var hpr = new Cesium.HeadingPitchRoll(180.0 \* Cesium.Math.RADIANS\_PER\_DEGREE, 180.0 \* Cesium.Math.RADIANS\_PER\_DEGREE, 0.0);

Regards

Marco
