Facetdata after position/rotation changes

Hi, I looked through the excellent documentation on facet data, and was enthousiastic to try it out. However I quickly noticed my position/rotation was not properly reflected.

If I take the example from the docs (Babylon.js Playground) and add a mesh.position.y = 2 somewhere after the mesh creation the green lines are not moved along with the shape.

The docs mention “mesh.computeWorldMatrix(true);” but adding this anywhere doesn’t seem to solve it.

I’m very new to babylon so I’m probably just missing something simple.
Thanks in advance.

Hello and welcome!

Babylon Playground (as well as Babylon Sandbox) have a great tool for debugging - Babylon Inspector.

Now let’s inspect meshes which you have in your scene. There are 2 of them: m and ls

You can change their positions or any other possible values from the Inspector.
Since there are two meshes in your example, you need just add:
lineSystem.position.y = 2;
and here we are: https://playground.babylonjs.com/#1YTZAC#99
If you need to call Inspector from your scene outside PG or Sandbox just use:

The vertex data stores the geometry of the mesh , position, rotation stored separately in a matrix. The green lines are drawn based on only the vertex data

See Baking Transformations | Babylon.js Documentation