Updating vertices of a tiled ground

Hi,

I am trying to update a vertices data of a plate.

I was able to add some noise on vertices position on Y axis resulting this mesh:
https://www.babylonjs-playground.com/#1XBLWB#249

As you can see the faces are now separated from each other. I thought this must be because faces does not share same vertices,

To maintain solid mesh, I tried to make it make it share verticles with

tiledGround.forceSharedVertices=true

But that does not have any effect on terrain mesh:
https://www.babylonjs-playground.com/#1XBLWB#250

So what are steps to make such noise and maintain solid area.

Thank you :slight_smile:

Also why in this scenario forceSharedVertices() method raises an error

TypeError: Cannot read property ‘0’ of undefined
at t.forceSharedVertices (babylon.js:16)

https://www.babylonjs-playground.com/#VKBJN#262

As written the forceSharedVertices method expects a mesh with normals and uvs defined https://www.babylonjs-playground.com/#VKBJN#263

Actually just uvs are needed https://www.babylonjs-playground.com/#VKBJN#264

Am working on a PR that will mean forceSharedVertices will work with a mesh of only positions and indices.

1 Like

Corrected.