# HTMLMESH. Replacing mesh with htmlMesh

**URL:** <https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585>\
**Category:** Questions\
**Tags:** mesh, html\
**Created:** [November 27, 2025, 1:44pm UTC](https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585 "2025-11-27T13:44:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk1wz](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@sk1wz](https://forum.babylonjs.com/u/sk1wz)\
**Post date:** [November 27, 2025, 1:44pm UTC](https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585/1 "2025-11-27T13:44:13Z")

</div>

Hi! I would like to ask how you can make an htmlMesh by replacing some kind of mesh. What I mean is, for example, we have a parent-monitor mesh. The monitor mesh has a child (a separate mesh “monitor screen”, I would like to create an htmlMesh to replace this mesh “monitor screen” with my htmlMesh. When replacing it, I want it to become instead of a mesh of the “monitor screen” and in width, height, position and 1 in 1 as well as a mesh of the screen As best

---

<div class="post-metadata">

**Author:** ![fuyutami](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fuyutami/32/49210_2.png) [@fuyutami](https://forum.babylonjs.com/u/fuyutami)\
**Post date:** [November 27, 2025, 3:44pm UTC](https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585/2 "2025-11-27T15:44:59Z")

</div>

Hi. Here is the example how you can do this: [Babylon.js Playground](https://playground.babylonjs.com/#ILAC9X)

---

<div class="post-metadata">

**Author:** ![sk1wz](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@sk1wz](https://forum.babylonjs.com/u/sk1wz)\
**Post date:** [November 28, 2025, 9:46am UTC](https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585/4 "2025-11-28T09:46:08Z")

</div>

```auto
Here, setContent sets the grid size. Is it possible to get this size from the mesh? So that it's 1:1?

```

---

<div class="post-metadata">

**Author:** ![fuyutami](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fuyutami/32/49210_2.png) [@fuyutami](https://forum.babylonjs.com/u/fuyutami)\
**Post date:** [November 28, 2025, 2:19pm UTC](https://forum.babylonjs.com/t/htmlmesh-replacing-mesh-with-htmlmesh/61585/5 "2025-11-28T14:19:30Z")

</div>

Yes, after importing your model select your screen mesh and use its bounding box info to calculate its size.

You can use minimum and maximum like I showed in the example or just double the extend size like so:

`const {x: yourMeshWidth, y: yourMeshHeight} = yourScreenMesh.getBoundingInfo().boundingBox.extendSize.scale(2)`

then use those calculated width and height values to set the size of html mesh: `htmlScreen.setContent(iframeSite, yourMeshWidth, yourMeshHeight) `

If it still does not work for you feel free to share your mesh in the playground it will be easier to show on your mesh.
