PDA

View Full Version : Normals index with glDrawElements !



Golgoth
03-06-2006, 08:08 AM
hi all!

how do we pass to glDrawElements GL_QUADS a cube with:

8 vertices
and
24 normals

is constructing a hard egde cube with 8 vertices possible?

usualy we do pass vertices and face index... normal count = vertex count... but what if we need to pass a normal index?

thx

Jan
03-06-2006, 08:54 AM
That's not possible, at the moment. You need to replicate the vertices in the vertex-array, so that you have 24 normals and 24 vertices, although always 3 vertices are the same.

Sorry, there is no other way. Maybe through a future extension, but that's not sure at the moment.

Jan.

jide
03-06-2006, 09:23 AM
Not sure for the moment ? Where can I find out some information about this ? I made a topic for that in the other forum but didn't have anything back.

Golgoth
03-06-2006, 09:33 AM
although always 3 vertices are the same.
in XIS for instance...

if u create a cube... u get automaticly hard edges but only 8 "points"... is "points" some kind of convention for shared vertices?

thx for your answer, it will save me a lot of time!

Jan
03-08-2006, 12:41 AM
No, "points" is no convention for shared vertices. It's a convention for a one-dimensional, infinitely small position in a given room (1D, 2D, 3D, ...). :D

Anyway, what you ask for, cannot be done in OpenGL. And even if it seems, that certain programs handle things like this (Modeller tools...), they still need to send duplicated data to the GPU for rendering. The user doesn't need to know about that, for him it's more practical to work with "shared" vertices.

Jan.