Dynamically Generated Custom Mesh Positioning


I create custom mesh but it’s position different then world center. I tried many things but i can’t fix it. Can you give me some advice?

Babylon.js Playground (babylonjs.com)

Instead of updating your meshes, you can call scene.createDefaultCamera(true, true, true); to create a camera that will be configured to show your entire scene:

There is must be a ground but when i create ground it’s the same. Also there is left menu which are show furnitures. There is same issue when i click for import mesh.

The scene is created first, except for the room(user does not see) in my project and after user draw room as 2d and when click next button the function run that in the link.

You could simply subtract a fixed (x,y,z) offset to all your coordinates, to move your geometry anywhere you want?

One way to compute this offset would be to simply sum all the coordinates of all the vertices and divide by the number of vertices.

1 Like

It’s working thank you very much:)