PlaneBufferGeometry Grid

I previously used a 128 x 128 png for the height map back when quads were still a thing, but ever since they were removed I needed to use a 129 x 129 png to match up with the geometry created above. (I still do not understand this and I’ve investigated it for an embarrassingly long time lol).

If you’re adjusting the vertex positions to create your heightmap from a 128x128 image you need a plane with 128 vertices in each dimension. new PlaneBufferGeometry(1000,1000,128,128); will yield a plane with 129 vertices in each dimension. It might be better to think about the segment numbers as representing the number of strips of triangles that make up the plane. By default both width and height are set to 1 which gives a basic plane made up of two triangles (one strip of triangles) but of course you get 2 vertices across each edge.

Try playing with the example viewer on the PlaneBufferGeometry docs page to see how the number of vertices on the plane changes as you adjust the width and height segments arguments.

1 Like