# Mesh vertex update

**URL:** <https://forum.babylonjs.com/t/mesh-vertex-update/42890>\
**Category:** Questions\
**Created:** [August 1, 2023, 8:29am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890 "2023-08-01T08:29:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lvjing1111122](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lvjing1111122/32/36450_2.png) [@lvjing1111122](https://forum.babylonjs.com/u/lvjing1111122)\
**Post date:** [August 1, 2023, 8:29am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/1 "2023-08-01T08:29:21Z")

</div>

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#SDYZX3%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

li.refreshBoundingInfo(true) is not effect

```auto
var points = []
    for (var i = 0; i < 100; i++) {
        // This is the effect I want, but I don't want to do it like this
        // points.push(new BABYLON.Vector3(i - 50, 5 * Math.sin(i / 5) + 10, 5 * Math.cos(i / 5))) 
        

        points.push(new BABYLON.Vector3(i - 50, 5 * Math.sin(i / 5), 5 * Math.cos(i / 5)))
    }

    var path3d = new BABYLON.Path3D(points)
    var curve = path3d.getCurve()
    var li = BABYLON.Mesh.CreateLines('li', curve, scene)
    li.position.y = 10

    // This update is not working，I know it needs to update all vertices，
    // mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions);
    // But this calculation is quite complicated
    li.refreshBoundingInfo(true)

```

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [August 1, 2023, 12:16pm UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/2 "2023-08-01T12:16:08Z")

</div>

What do you mean by “not working”?

---

<div class="post-metadata">

**Author:** ![lvjing1111122](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lvjing1111122/32/36450_2.png) [@lvjing1111122](https://forum.babylonjs.com/u/lvjing1111122)\
**Post date:** [August 2, 2023, 5:49am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/3 "2023-08-02T05:49:34Z")

</div>

> [@lvjing1111122](#):
>
> li.refreshBoundingInfo(true)

This line of code cannot update mesh vertex coordinates

```auto
var li = BABYLON.Mesh.CreateLines('li', curve, scene)

li.position.y = 10

```

do somethin update mesh vertex,

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [August 2, 2023, 1:40pm UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/4 "2023-08-02T13:40:17Z")

</div>

You are changing the position of a mesh and you want to update its bounding info?

---

<div class="post-metadata">

**Author:** ![lvjing1111122](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lvjing1111122/32/36450_2.png) [@lvjing1111122](https://forum.babylonjs.com/u/lvjing1111122)\
**Post date:** [August 3, 2023, 8:00am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/5 "2023-08-03T08:00:55Z")

</div>

yes, it’s like this

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [August 3, 2023, 12:18pm UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/6 "2023-08-03T12:18:09Z")

</div>

When you update the `position` property of a mesh, you aren’t updating its vertices positions, instead, you’re updating its transformation matrix. This is reflected on the bounding information, where you both have the min/max in vertex space, and in world space: [BoundingBox | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/typedoc/classes/BABYLON.BoundingBox#minimumWorld), which will take the transformation matrix into account.

---

<div class="post-metadata">

**Author:** ![lvjing1111122](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lvjing1111122/32/36450_2.png) [@lvjing1111122](https://forum.babylonjs.com/u/lvjing1111122)\
**Post date:** [August 4, 2023, 1:17am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/7 "2023-08-04T01:17:01Z")

</div>

Yes, it’s exactly what I thought

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [August 4, 2023, 11:13am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/8 "2023-08-04T11:13:33Z")

</div>

Does this answer your question? 🙂

---

<div class="post-metadata">

**Author:** ![lvjing1111122](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lvjing1111122/32/36450_2.png) [@lvjing1111122](https://forum.babylonjs.com/u/lvjing1111122)\
**Post date:** [August 7, 2023, 3:12am UTC](https://forum.babylonjs.com/t/mesh-vertex-update/42890/9 "2023-08-07T03:12:49Z")

</div>

thank you
