-
What do you want to achieve?
I want to be able to generate hollow Cylinders using math. -
What is the issue?
I do not know the math used to generate Cylinders. I only know the math for a circle and Sphere. -
What solutions have you tried so far?
I have tried asking in various discords. Looked on Google and Dev forum.
Circle Generation.
local Radius = 1
local Circle = math.pi * 2
local Amt = 10000
for Number = 1, Amt do
local Angle = Circle / Amt * Number
local X = math.sin(Angle) * Radius
local Z = math.cos(Angle) * Radius
end
Sphere Generation
local function fibonacci_spiral_sphere(num_points)
local vectors = {}
local gr = (math.sqrt(5) + 1) / 2
local ga = (2 - gr) * (2 * math.pi)
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
If anyone could help that would be nice (I’m trying to create a game like no man’s sky).