我在这里使用这个函数创建点。
local GR = (math.sqrt(5) + 1) / 2
local GA = (2 - GR) * (2 * math.pi)
local function fibonacciSpiralSphere(num_points)
local vectors = {}
for i = 1, num_points do
local lat = math.asin(-1 + 2 * i / (num_points + 1))
local lon = GA * i
local x = math.cos(lon) * math.cos(lat)
local y = math.sin(lon) * math.cos(lat)
local z = math.sin(lat)
table.insert(vectors, Vector3.new(x, y, z))
end
return vectors
end
Run Code Online (Sandbox Code Playgroud)
我只是不知道如何用它们制作球体网格。
类似的事情通常可以使用Delaunay Triangulation来解决。
由于您对点集有一定的了解,您可以简单地找到每个点的最近邻居。因此,遍历点集并检查距离。