# Cesium3DTileset changes location when applying rotation / HeadingPitchRoll using modelMatrix

**URL:** <https://community.cesium.com/t/cesium3dtileset-changes-location-when-applying-rotation-headingpitchroll-using-modelmatrix/34230>\
**Category:** CesiumJS\
**Created:** [August 1, 2024, 12:23am UTC](https://community.cesium.com/t/cesium3dtileset-changes-location-when-applying-rotation-headingpitchroll-using-modelmatrix/34230 "2024-08-01T00:23:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [August 1, 2024, 12:31am UTC](https://community.cesium.com/t/cesium3dtileset-changes-location-when-applying-rotation-headingpitchroll-using-modelmatrix/34230/2 "2024-08-01T00:31:23Z")

</div>

The reason for the observed behavior is explained in [3DTileset rotation - #2 by Marco13](https://community.cesium.com/t/3dtileset-rotation/27554/2) , including a Sandcastle showing how to solve this. That approach, applied to your Sandcastle, is shown here:

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=zVZta9w4EP4rYjmoczjaTd8oyTa0SRMauL6QuAcH/lDZnuyKyJKRxptsS/77jSzb8brbuzQQ6CdrpHmeedHMyLnRDtlKwjVY9pppuGbH4GRd8r+bvSid5I18bDQKqcGmk52DVKc675EfTAGKwN9TzdgSRCH1Yp/NYi9WEvNlJ1ijFK1TfdswtIautMmvTI0crcivop5xaAaNUZnwHhYmr0vQyBeAJwr88mh9VpCfrU7wb8wtqkqtj6T2vrk7G3HHHIwpIFNSgQMkGe06xNRukXVxLSR2GQqfZ++ScMwvrSnPjH7rSCCPns9evXzpeVmbX+5y0MArK0uJcgWOi6KIWvItigtlMuAFVLhMwOHbBeXfYQLW0oKcQVvDEPXNmDIxkd/pfY6DNLjX9+GCPvuLORd6AS2AsRmfxd16d8Zf9ELLxTNTNwm8qJZggVsiqh37kz3ls6C64z8+kluWC+JnETlr7E5Io79Ko4Ars4i+nvgDpkzjTGdhn/3xvUHcfm1Y7gpAakqZUOfGYGKFdpfGlpSCNqYPAq28ec5zZTR0GeWWlH1RBW1PuP3kZzyjzbN3Jx+Ts+SfIVHpiygoPIAl1Ze1zlEazeqqEAhNTb7/fB4NMoZdS52LYsPGkqOhPUlR3BU0b5VDOQV8Fa76PuhGdYj1LXs/qNcMyIHn1WiobBQfAaK72OLez7izOnSEOgLHI+pYWKSV0M+iLZbH19LXjeuS1LuRmFN5A8WpFSVEwVLsKcasDykVNkaUtUJJ0ygq461lHbPyf3F9eL3y9oosuy4azUOP8BP0U+bArkSmYDgT00mbIJqljaarM5dbmUG0Wac7Bw/gbq75UZh92dyP+ELoIhcOaRrRDE7CG3BUIxpNL8mpWtO70KU0ncSs79OuM3/DkRsiGw+Sg0k8mTtcKzjsuN/IsjIWWW1VxPkUoawUYdw0q/Mrspk7F2qKsfl0CJ0XcsVk8XrLPwHLlXCOTi5rpS7kN0gnh/Mp6f8AbUf+pxVYJdZebbl3+FfY5JzPpyRuR/YPfB+JPztsszvE0InUVU2P+boCQlqfdHKylJqk3b1XMy+IGxLC2iFUJMz4HgmUQLGb0b8C7ayEqmG/G8Exa+QvTY732ZPGyJOhQxtmEW7Qk1M6SHrxn9QDko3omqL5tdj4RnT8PvE1PfkY0bXNvj02P3ofPTQ/FB4jsjBsuiIdRPEv)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Note that some details here depend on where and how “the location” of the tileset is represented. The solution here assumes that it is represented with the transform of the root tile.

---

_[View the full topic](https://community.cesium.com/t/cesium3dtileset-changes-location-when-applying-rotation-headingpitchroll-using-modelmatrix/34230)._
