procedurally generate a sphere mesh

后端 未结 5 1011
既然无缘
既然无缘 2020-12-13 02:38

i am looking for an algorithm ( in pseudo code) that generates the 3d coordinates of a sphere mesh like this:

\"

5条回答
  •  半阙折子戏
    2020-12-13 03:07

    just a guess, you could probably use the formula for a sphere centered at (0,0,0)

    x²+y²+z²=1
    

    solve this for x, then loop throuh a set of values for y and z and plot them with your calculated x.

提交回复
热议问题