diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-24 13:00:32 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-24 13:00:32 +0100 |
| commit | 3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2 (patch) | |
| tree | 8cb37f008165eda145345d9ce4b214e87f0f5682 /src | |
| parent | 375c3413171c48cdf921129371c614b5aa6a5787 (diff) | |
| download | Multimedia-3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2.tar.gz Multimedia-3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2.zip | |
Use values from first row for last row
Diffstat (limited to 'src')
| -rw-r--r-- | src/glsphere.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsphere.cpp b/src/glsphere.cpp index 9e721c6..feac80b 100644 --- a/src/glsphere.cpp +++ b/src/glsphere.cpp @@ -38,7 +38,7 @@ void GLSphere::makeSurface(QVector<GLPoint> *pointContainer, m_firstIndex = m_indices->size(); - for (int slice = 1; slice < m_slices - 1; slice += 2) + for (int slice = 1; slice < m_slices; slice += 2) { m_indices->append(m_firstPoint); @@ -52,10 +52,12 @@ void GLSphere::makeSurface(QVector<GLPoint> *pointContainer, for (int stack = m_stacks - 2; stack >= 0; stack--) { - m_indices->append((m_firstPoint + 1) + stack + ((m_stacks - 1) * (slice + 1))); - m_indices->append((m_firstPoint + 1) + stack + ((m_stacks - 1) * slice)); + m_indices->append((m_firstPoint + 1) + stack + (slice < (m_slices - 1) ? + (m_stacks - 1) * (slice + 1) : 0)); + m_indices->append((m_firstPoint + 1) + stack + (m_stacks - 1) * slice); } } + m_indices->append(m_firstPoint); m_nextIndex = m_indices->size(); |
