Procedural Mesh C++, Perlin Noise, Infinite Terrain Math Question

Well yea, you have a nested loop, one loop inside the other for creating a grid line.
You got your Vertice array that you add inside PlayerLoc.X PlayerLocY, and at the end on the Z you add your perlin noise * 350 ? why *350 this can have a huge magnitude.

So PlayerLocX + x so it’s your player location + counting x on the grid, that is not good. So what you are going to get inside your Vertex Possition Array is your player location all over the grid line, each vertex point you add in floats will contain your x grid line that you are using to build the grid + that(playerLoc.x and y) . So it is what I was saying, build an independent grid line first, you are building your grid line with player location embeded in it, each possition of vertexes will contain + player location offseting it while you roam around.

There for why it constantly get’s distorted because it constantly adds the player position distorting it. So you have to rethink maybe and build the grid line first, and then make another section you know but with the same lod number, same section number and modify it then with player location.

1 Like