Greetings, I am currently trying to form a sphere with a smooth surface using parts in Roblox Studio. So far I have been able to generate points that make up a sphere using Spherical coordinates and few for loops, here is what I have been able to create so far.
My question now is, how would I go about connecting these points with triangles to form the surface of the sphere? I already have a module I can use to create a triangle from three points, what I need to know is how do I go about determining which points I should be connecting together to form the triangles of the surface?
Does every ring have the exact same amount of points and if so, are the points in order from first created - last created?
In that case let’s say we take 2 rings.
local ring1 = {...} -- Imagine Vector3 points in here.
local ring2 = {...} -- Also has Vector3 points in it.
local points = #ring1 - 1 -- Stop right before the last point or else we go out of range.
for i = 1, points do
local left_upper_corner = ring1[i]
local right_upper_corner = ring1[i + 1]
local left_lower_corner = ring2[i]
local right_lower_corner = ring2[i + 1]
...
end
So here we already have 4 corners.
Now all we have to do is create triangles (or quads), though I currently do not remember how to do that exactly.
But, you can create a triangle from left_upper_corner, right_upper_corner and left_lower_corner.
And a 2nd triangle from right_upper_corner, left_lower_corner and right_lower_corner.