QGLSphere ClassThe QGLSphere class represents the geometry of a simple sphere in 3D space. More... #include <QGLSphere>This class was introduced in Qt 4.8. Public Functions
Detailed DescriptionThe QGLSphere class represents the geometry of a simple sphere in 3D space. The following example creates a sphere of 2 units in diameter and draws it at (10, 25, 0) in a QGLPainter: QGLBuilder builder; builder << QGLSphere(2); QGLSceneNode *node = builder.finalizedSceneNode(); painter.translate(10, 25, 0); node->draw(&painter); The QGLSphere class specifies positions, normals and 2D texture co-ordinates for all of the vertices that make up the sphere. The texture co-ordinates are fixed at construction time. This is because constructing the sphere can involve generating additional vertices which need to interpolate the texture co-ordinates of their neighboring vertices. The default mode of QGLSphere is a "UV sphere", which divides the sphere up into longitudinal and latitudinal sections. The longitudinal slices meet at the poles, which in a single unit sphere are defined to be at (0, 0, +0.5) and (0, 0, -0.5). This choice is the simplest to texture map as the texture will only distort along the x-axis of the 2D texture. However the density of vertices is significantly higher at the poles than it is elsewhere on the sphere and is a poor choice if a uniform density of pixels from the texture map is required. See also QGLBuilder. Member Function Documentation
|
| Level of Detail | Number of Triangles |
|---|---|
| 1 | 64 |
| 2 | 128 |
| 3 | 256 |
| 4 | 512 |
| 5 | 1024 |
| 6 | 2048 |
| 7 | 4096 |
| 8 | 8192 |
| 9 | 16384 |
| 10 | 32768 |
See also setSubdivisionDepth().