Generate a 3d polygon with amount of points

Does anyone know of a formula that can do this