summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsphere.cpp38
-rw-r--r--src/mmscene.cpp2
2 files changed, 26 insertions, 14 deletions
diff --git a/src/glsphere.cpp b/src/glsphere.cpp
index d77ef95..8b68b7c 100644
--- a/src/glsphere.cpp
+++ b/src/glsphere.cpp
@@ -21,23 +21,35 @@ void GLSphere::makeSurface(QVector<GLPoint> *pointContainer,
m_firstPoint = m_points->size();
for (int slice = 1; slice < m_slices; slice += 2)
- {
- m_points->append(GLPoint(northpol, n0, t0, GLColorRgba::clMagenta));
-
- for (int stack = 1; stack < m_stacks; stack++)
{
- m_points->append(GLPoint(calculatePoint(2 * M_PI * slice / m_slices,
- stack * M_PI / m_stacks), n0, t0,
- m_color));
+ m_points->append(GLPoint(northpol, n0, t0, GLColorRgba::clMagenta));
- m_points->append(GLPoint(calculatePoint(2 * M_PI * (slice - 1) / m_slices,
- stack * M_PI / m_stacks), n0, t0,
- m_color));
+ for (int stack = 1; stack < m_stacks; stack++)
+ {
+ m_points->append(GLPoint(calculatePoint(2 * M_PI * slice / m_slices,
+ stack * M_PI / m_stacks), n0, t0,
+ m_color));
- }
+ m_points->append(GLPoint(calculatePoint(2 * M_PI * (slice - 1) / m_slices,
+ stack * M_PI / m_stacks), n0, t0,
+ m_color));
+
+ }
+
+ m_points->append(GLPoint(southpol, n0, t0, GLColorRgba::clMagenta));
- m_points->append(GLPoint(southpol, n0, t0, GLColorRgba::clMagenta));
- }
+ for (int stack = m_stacks - 1; stack > 1; stack--)
+ {
+ m_points->append(GLPoint(calculatePoint(2 * M_PI * slice / m_slices,
+ stack * M_PI / m_stacks), n0, t0,
+ m_color));
+
+ m_points->append(GLPoint(calculatePoint(2 * M_PI * (slice + 1) / m_slices,
+ stack * M_PI / m_stacks), n0, t0,
+ m_color));
+
+ }
+ }
m_nextPoint = m_points->size();
}
diff --git a/src/mmscene.cpp b/src/mmscene.cpp
index f199563..8de2c87 100644
--- a/src/mmscene.cpp
+++ b/src/mmscene.cpp
@@ -96,7 +96,7 @@ void MMScene::createSphere()
{
m_sphere = new GLSphere();
- m_sphere->setDrawingMode(GL_POINTS);
+ m_sphere->setDrawingMode(GL_TRIANGLE_STRIP);
m_sphere->makeSurface(&m_points, &m_indices);
}