# Mesh Instances - new Cesium.ModelMesh()?

**URL:** <https://community.cesium.com/t/mesh-instances-new-cesium-modelmesh/16503>\
**Category:** CesiumJS\
**Created:** [December 11, 2021, 3:27pm UTC](https://community.cesium.com/t/mesh-instances-new-cesium-modelmesh/16503 "2021-12-11T15:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dihand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dihand/32/6622_2.png) [@dihand](https://community.cesium.com/u/dihand)\
**Post date:** [December 11, 2021, 3:27pm UTC](https://community.cesium.com/t/mesh-instances-new-cesium-modelmesh/16503/1 "2021-12-11T15:27:27Z")

</div>

Hi - I have been trying for a long time to get this to work somehow - however all my attempts are unsuccessful - did someone figure it out? This works for one model - BUT as soon as I want to run this in a loop - sandbox error

[https://cesium.com/learn/cesiumjs/ref-doc/ModelMesh.html](https://cesium.com/learn/cesiumjs/ref-doc/ModelMesh.html)

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=rVZtb9s2EP4rnD80UuNQdl42VHGCBWm7FUjQIAkGDPMQMBJtEaVIlaQce2v++46kJNOyl6XAmMA2j/d+9xyZSaENkrr8VJI5VasbJRcspwqdIUGf0CXVrC7x54qKO6MoNdek6nFGf08FalateIr2CmMqnSYJwYZxiiUIaydckgpLNU/2puI5Pp2KrGf8iqz6lsOTaNtNq2VBFFow+tQX/c3Ror3MbS+lMIQJqvaGqPH4kWjqFN+w7AtVKTKqpkN/xgK7ad/FhkcXsub5hQBeQzekDSspB2Oe2ESbJN5LTJeGijxq3PREv/kkdEUzI9U1WzJhheyfDTCjwlB1JcWcmTqnEOnBTyf4x/Hh6N3x0fh0g4mYlud4hEfHhydHI2B0HpQypxw/ZCQraP4LNzP8MLefJdUF1X+M/8SClLStjP09BjXTgXfv4YKp6eA0PD50x1COKjiANnBkjJPu/46UFafviSHeCZ14naAyWWvHc/7oFLlwZC0MKBqPRg1FVyRjYg40CGw0OmzIBWXzwnKeALmhzRXL79hfNgvXxBRYf1Umchq7tPpqaMgaxZViJTNsQTUmeVeba5eumZKlzZXvdBt16mN31XbRgAnFlmnbeveKCD2TqtS4oCQHl2+YyYpbyfm9/MiWNP+oQEHku6URuiTKwC8ijpzF93QOmNFRi65eBwx79KboHdnnxO/ijhrA49eeY9Eaxi5hEEIuyygeou89iEOrJQN81OUNBM1dPVJ05BNnuySFj6HFR4wV+GNxXTJNsSmoiHxq0dm5B6ztLQnzhMt5NB3cfrh4//t0MPRMtqYuGa7/II22G3yzz2FoQXdHrmItX5K8wOl3lj9UuzZ9/+Hu3lq2wp6jmRmzyOn74ewM1SKnM5gAedwMmzZX0BUo4tSgle3iU/iadL0Ku/39GAUDteNeeu7lBvey4V7z22XZeTAo+qNjv4PRWxQt0cEaKgk6jNG3bzskNur7FhB5usPmeu70BtGGxdX/Z7GSGjArBVh8HYYC8S0cBWd9LK1XiKp2xTs8a1DfDp82jl0xWPy9gk8BRF/BpjPCbQWiDUbI5xiPYptuvCuRwQxb5/L7hli42rrsSOBLA6ixMvQ5GbqQ4+1c9/u9hd2bN2Ec8RYuEHpp4r/oqrsHwofOetnrM3WjYLjr2L4xbqAUKfKTbptj4/4INjuYn+M+rd8C3RtjZ4zrgRXo3EyTH4zrWbe0g24ZCj23P7sf/vu5G4TNe2fjls2gUxTBmhr7LPOpzMEdJohDcPofCO7ffv1rD41P4EEAPe7SJhWDY6c5DcdpC8vOmkOJkbdAhmaPQBwygCiBaoJ7M1JzgxaE1xQxbd8cKBJSmSKog8fvvyk8eGdVurz29EVcyi/Wl1w+iUCfw3nqbL20+vq6GkDqB8PBRJsVp+et2p9ZWYHftgcjeIsZCm8xeLPq5LGGl6/BmdZtiSdJKDrJ2QKx/Gw66L2ipwOUcaI1nMxq7m726eB8kgD/liiXLuufF1RxsrJsxfj8yhMxxpMEtrsljZT8kaie5n8A)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

---

<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:** [December 12, 2021, 2:34am UTC](https://community.cesium.com/t/mesh-instances-new-cesium-modelmesh/16503/2 "2021-12-12T02:34:36Z")

</div>

I assume that the goal is to re-use the same model, and render it many times, with different orientations.

(And this should be done without _loading_ the model many times. Technically, it would be possible to re-instantiate the model each time, with `Cesium.Model.fromGltf`, **but** this will probably become prohibitively expensive for more complex models or a high number of models, and I assume that your attempt to pass on the `gltf` to the next model aimed exactly at avoiding this…).

The recommendation for cases like this seems to be to use a `ModelInstanceCollection` (searching for that reveals some related threads).

Applying this to your example:

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=pVZtb9s2EP4rhL9YbhXKzsuGOm6wIkXXAAkaJN2+1EVAS2eLK0VqJOXYa/PfdyRlmVba7sOUwBaPd889PD5HOlfSWKJMdVWxFejtrVZrXoAmr4mER3IJhjcV/VCDvLcawN6wuueZfJ1L0j6NFlMyLK2tzTTLGLVcAFUYbHxwxWqq9CobzuXT6Hwu817ya7btZ45nkuc0HcqaabLm8NgP/dPbkmHuh5dKWsYl6GFKWsYLZsAD3/L8C+gpsbqBNMzxKO+0T7H1MaVqRPFGoq+Fg2jLKxCYLBjb1WZZYElhY0EWSUszGMPgSpoacqv0Dd9w6YLcn1tgDtKCvlZyxW1TAK706Ncz+svkePzq9GRyfuDE7M7ndEzHp8dnJ2N09AwqVYCgDznLSyh+F3ZJH1buswJTgvk0+Uwlq2C3M+59gjDzQaD38Ibr+eA8nj7207gddTSBMvBmSrPu/55VtYC3zLJAwmQBEyGzPTpdiYUH8stRjbQINBmPW4upWc7lCm24sPH4uDWXwFel8zxDc2tbaV7c839cFW6YLan5W9vEI4ayZhm51IAbR2wJZMiRN5MolSFhWrNtSh5LnpeEG8JkMPkYWzKLxLyWDFGLv3C7TLAWYHLNFwGww0t9WAkaiJJi62INN9atQi29qy8HQQ1pjv6BfReO9D99RsJLpUkiwJKtW/w5fs26JeLo5ctRUHXntwl+mwO/TesXVOrcRKSovsZedvV+QZINOdrXNCPHI/Lt23cifK01k4WqktEL3LrzKNdemD2lHmTa/v9MtTLcciUxU9tll0xbfGPyhC61qt7CCg8kk+yPrq4QaWRr+UWmILUwHkUZS2BFUOYBr5gTt6inH89rJcRPpk3OhKtccuCAdZjQ8ciVicYF8Jq6cZLa7GvwEaMMCqQytKV76zjdYeKP6h3fQPFOY0tHRdnVMSpAdMC+74EkLWoa1pr6JY0Oa9UJm9aNKfd3R0x4Go+Cw1OIf8Kj9HnzhgbaIWOHCYFd6bbfbXXk8sfddWhHrJ43h5atvW/bjR3BKXZiOK8Nig9orXmFxVgjdVYUSVSHGwd+1cZddtnD4txZOHWfvob7vp7u39390J31IWWO+6AZNWDdLRaQkCweG8yTnf6HrnvtkvYaLiWTszGelSNPSmmOsx54Sr7GWg+a7pJ56Vl1h2ZUUoLhBIsJzNgU2S1ZIyxZM9GAOzYRniRSaVuOIkH5JvgR4NErB4kPoh7iJUKpL45LoR5lhOebZupz/ezp47Wi8hfzIB3MjN0KuNjB/sarGnm7TUvw5rKANxdqzWSLBn8nWJobs5PzLItDZwVfE168ng96vznmA5ILZgzOLBsh3Mk2H1zMMvR/FiqUr/qHNWiBlw66lZOL62CklM4yHH4/0iolFkz3kP8F)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Someone from the core Cesium team should confirm that this is the right approach.

---

<div class="post-metadata">

**Author:** ![dihand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/dihand/32/6622_2.png) [@dihand](https://community.cesium.com/u/dihand)\
**Post date:** [December 12, 2021, 11:07am UTC](https://community.cesium.com/t/mesh-instances-new-cesium-modelmesh/16503/3 "2021-12-12T11:07:14Z")

</div>

Great! Thanks @Marco13! This is what me need
