Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-03-13 14:11:05 +0000
committerStijn Buys <ingar@osirion.org>2011-03-13 14:11:05 +0000
commitc1970ea4f19b6ea3b602ccece6d02b4d45f238cf (patch)
tree2e6fe141e7a9c3d60fcdd020df36c29aa2050874 /src/model
parent49fb18f0d5ec9643794e0cbe156c27a9883e5dd7 (diff)
Corrected texture coordinates of the built-in sphere model.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/vertexarray.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model/vertexarray.cc b/src/model/vertexarray.cc
index 881e266..ae91f6c 100644
--- a/src/model/vertexarray.cc
+++ b/src/model/vertexarray.cc
@@ -85,15 +85,16 @@ void VertexArray::add_sphere()
v = math::Vector3f(r * costable[i], r * sintable[i], costable[j]);
n = v;
n.normalize();
+
texx = (float)i / (float)(SPHERESEGMENTS - 1);
- texy = -costable[j] / 2 + 0.5f;
+ texy = 2.0f * (float) j / (float)(SPHERESEGMENTS - 1);
add_vertex(v, n, texx, texy);
v = math::Vector3f(r1 * costable[i], r1 * sintable[i], costable[j+1]);
n = v;
n.normalize();
texx = (float)i / (float)(SPHERESEGMENTS - 1);
- texy = -costable[j+1] / 2 + 0.5f;
+ texy = 2.0f * (float)(j + 1) / (float)(SPHERESEGMENTS - 1);
add_vertex(v, n, texx, texy);
quad_count++;