src/gl/vertexprogram.cpp

changeset 196
6bcb284679d4
parent 172
50f055543ff6
child 200
ca23936b455b
equal deleted inserted replaced
195:6e79c1cb83e6 196:6bcb284679d4
35 { 35 {
36 std::vector<glm::vec3> result; 36 std::vector<glm::vec3> result;
37 result.reserve(12 * d2 * d2); 37 result.reserve(12 * d2 * d2);
38 for (int i = 0; i < d2; ++i) 38 for (int i = 0; i < d2; ++i)
39 { 39 {
40 const float alpha = i * math::pi / d2; 40 const float alpha = i * pi<> / d2;
41 const float alpha_2 = (i + 1) * math::pi / d2; 41 const float alpha_2 = (i + 1) * pi<> / d2;
42 for (int j = -d2; j < d2; ++j) 42 for (int j = -d2; j < d2; ++j)
43 { 43 {
44 const float beta = j * math::pi / d2; 44 const float beta = j * pi<> / d2;
45 const float beta_2 = (j + 1) * math::pi / d2; 45 const float beta_2 = (j + 1) * pi<> / d2;
46 const float x1 = cos(beta) * sin(alpha); 46 const float x1 = cos(beta) * sin(alpha);
47 const float x2 = cos(beta) * sin(alpha_2); 47 const float x2 = cos(beta) * sin(alpha_2);
48 const float x3 = cos(beta_2) * sin(alpha_2); 48 const float x3 = cos(beta_2) * sin(alpha_2);
49 const float x4 = cos(beta_2) * sin(alpha); 49 const float x4 = cos(beta_2) * sin(alpha);
50 const float z1 = sin(beta) * sin(alpha); 50 const float z1 = sin(beta) * sin(alpha);

mercurial