After searching Google found the following functions:
gluSphere(...)gluCylinder(...)
However, these functions do not work in ES, as I understand it, in ES there is a possibility to draw only points, lines and triangles.
I have seen examples where a cube is drawn: 6 faces, each of which consists of 2 triangles. A circle, a ring, a rectangle with rounded corners, and everything else are drawn in the same way from triangles.
I came to the conclusion that the sphere and the cylinder should also be drawn from triangles.
For a cylinder: Two circles from GL_TRIANGLES_FAN - the base of the cylinder, a lot of "narrow" rectangles GL_TRIANGLES_STRIP - for the lateral surface of the cylinder - the more - the more beautiful and less efficient.
For a sphere: it’s harder here, I think you can make GL_TRIANGLES_STRIP out of multiple squares (two triangles per square) - again, the more such squares, the smoother the sphere should be.
Questions only 2:
- Is the correct approach to drawing 3D bodies from simple triangles or is there a more correct way?
- Will there be problems when applying textures to such bodies, or how to apply textures? :)
Thanks for answers!