For a project I want to do, I have to be able to draw a sphere (using OpenGL). The thing is I don't know how to get the vertices for a sphere. The way I do circles is this: for(int angle=0;angle<360;angle++){
Vertices.x[angle]=cos(angle)*radius;
Vertices.y[angle]=sin(angle)*radius;
}
Is there any way that I can get the vertices for a sphere in a similar way?
Asked
Active
Viewed 206 times
0

a useless dragon
- 67
- 1
- 7
-
why not just export a sphere from blender or mesa? – Gnimuc May 27 '16 at 02:18
-
It's because I prefer to program things myself rather than use external programs such as blender to make them. – a useless dragon May 27 '16 at 02:24
-
search about spherical coordinates, it's the same principle of doing circle – GLCraft May 27 '16 at 12:07