# Scatter Mesh in trois.js

**URL:** <https://discourse.threejs.org/t/scatter-mesh-in-trois-js/49343>\
**Category:** Questions\
**Tags:** troisjs\
**Created:** [March 20, 2023, 4:45pm UTC](https://discourse.threejs.org/t/scatter-mesh-in-trois-js/49343 "2023-03-20T16:45:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yubo\_azdiadi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yubo_azdiadi/32/34413_2.png) [@yubo\_azdiadi](https://discourse.threejs.org/u/yubo_azdiadi)\
**Post date:** [March 20, 2023, 4:45pm UTC](https://discourse.threejs.org/t/scatter-mesh-in-trois-js/49343/1 "2023-03-20T16:45:36Z")

</div>

What is the best way to extend the trois.js library [https://troisjs.github.io/](https://troisjs.github.io/) to be able use the scattermesh example? [three.js examples](https://threejs.org/examples/?q=scatter#webgl_instancing_scatter)

when i understand it correctly, the meshsurfacesampler.js ([three.js/MeshSurfaceSampler.js at 724575ae82a282f468e15eb69a241ea0b29bba62 · mrdoob/three.js · GitHub](https://github.com/mrdoob/three.js/blob/724575ae82a282f468e15eb69a241ea0b29bba62/examples/jsm/math/MeshSurfaceSampler.js)) is missing. What would be the best way to implement it in trois?
