pub fn height_mesh<S: Shape<u32, 2>>(
height_map: &[f32],
map_shape: &S,
min: [u32; 2],
max: [u32; 2],
output: &mut HeightMeshBuffer,
)Expand description
Generates a mesh with a vertex at each point on the interior of [min, max].
The generated vertices are of the form [x, height, z] where height is taken directly from height_map.
Surface normals are estimated using central differencing, which requires each vertex to have a complete Von Neumann neighborhood. This means that points on the boundary are not eligible as mesh vertices, but they are still required.
This is illustrated in the ASCII art below, where “b” is a boundary point and “i” is an interior point. Line segments denote the edges of the mesh.
b b b b
b i - i b
| / |
b i - i b
b b b b