I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better.
Example of a geodesic sphere: https://i.stack.imgur.com/iNQfP.png
Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the
main()
Then in the
main()
:You actually only need to use
initialize_sphere()
once and use the result for every sphere you want to draw.