On 21 July 2010 21:56, Misha Koshelev <misha680(a)gmail.com> wrote:
+ /* first vertex and normal */ + vertex = 0; + test_vertex_data[vertex].position.x = 0.0f; + test_vertex_data[vertex].position.y = 0.0f; + test_vertex_data[vertex].position.z = radius; + test_vertex_data[vertex].normal.x = 0.0f; + test_vertex_data[vertex].normal.y = 0.0f; + test_vertex_data[vertex].normal.z = 1.0f; + vertex++; + assert(vertex < MAX_VERTICES); An assert probably isn't very useful after the fact, but it seems to me that dynamically allocating an array of the appropriate size is nicer anyway.
+static DWORD compute_sphere_test_index_data(FLOAT radius, UINT slices, UINT stacks) I haven't really thought this through yet, but would it perhaps be simpler to calculate the faces a vertex is part of, instead of the other way around?