madmanchan

03-26-2003, 06:22 AM

Hi,

Is it possible to use vertex arrays / indexed lists (e.g. glDrawElements or some version of it) when I have a triangle mesh with a different number of normals and vertices?

Take a simple example: a cube has 6 faces (12 triangles) and 8 vertices. But we actually have 6 unique normal directions (one in each direction of the faces of the cube).

So if vertices and normals are each represented as 3 floats, then the vertex array would have 8*3 = 24 floats, and the normal array would have 6*3 = 18 floats. For proper rendering, each vertex needs to be drawn three times (each time with a different normal) because each vertex is shared by three faces, each with its own normal.

Is there a way to set up indexed lists / vertex arrays to do this? It could be done by replicating the vertex data, but this seems like a waste.

Thanks,

Eric

Is it possible to use vertex arrays / indexed lists (e.g. glDrawElements or some version of it) when I have a triangle mesh with a different number of normals and vertices?

Take a simple example: a cube has 6 faces (12 triangles) and 8 vertices. But we actually have 6 unique normal directions (one in each direction of the faces of the cube).

So if vertices and normals are each represented as 3 floats, then the vertex array would have 8*3 = 24 floats, and the normal array would have 6*3 = 18 floats. For proper rendering, each vertex needs to be drawn three times (each time with a different normal) because each vertex is shared by three faces, each with its own normal.

Is there a way to set up indexed lists / vertex arrays to do this? It could be done by replicating the vertex data, but this seems like a waste.

Thanks,

Eric