Using the ArrayMesh =================== This tutorial will present the basics of using an `ArrayMesh`. To do so, we will use the function `add_surface_from_arrays()`, which takes up to four parameters. The first two are required, while the second two are optional. The first parameter is the `PrimitiveType`, an OpenGL concept that instructs the GPU how to arrange the primitive based on the vertices given, i.e. whether they represent triangles, lines, points, etc. See `Mesh.PrimitiveType 0 and j > 0: indices.append(prevrow + j - 1) indices.append(prevrow + j) indices.append(thisrow + j - 1) indices.append(prevrow + j) indices.append(thisrow + j) indices.append(thisrow + j - 1) if i > 0: indices.append(prevrow + radial_segments - 1) indices.append(prevrow) indices.append(thisrow + radial_segments - 1) indices.append(prevrow) indices.append(prevrow + radial_segments) indices.append(thisrow + radial_segments - 1) prevrow = thisrow thisrow = point # Insert committing to the ArrayMesh here. ``` Saving ------ Finally, we can use the `ResourceSaver` class to save the ArrayMesh. This is useful when you want to generate a mesh and then use it later without having to re-generate it. gdscript GDScript ``` # Saves mesh to a .tres file with compression enabled. ResourceSaver.save("res://sphere.tres", mesh, ResourceSaver.FLAG_COMPRESS) ```