summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-11-24 13:00:32 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-11-24 13:00:32 +0100
commit3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2 (patch)
tree8cb37f008165eda145345d9ce4b214e87f0f5682 /src
parent375c3413171c48cdf921129371c614b5aa6a5787 (diff)
downloadMultimedia-3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2.tar.gz
Multimedia-3760dbf5adb6fa6a1c7bf529622b8a3a0d99a6d2.zip
Use values from first row for last row
Diffstat (limited to 'src')
-rw-r--r--src/glsphere.cpp8
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();