View Full Version : Probably easy glDrawElements question for you

09-12-2002, 01:45 PM
First of all let say it this report of greeting toward the whole of you!


I cannot find French-Candian (OR OTHER) forum useful:

Articles use glDrawElements, they be loaded, and however the structure coordinates, the summits etc.... are another number????

I experienced that openGL it wants that I have all blocks of data the same size. How is it which is possible that I can furnish the data, so that I can use myself it over glDrawElements?

It would be really useful, if you could give me the connections to the instruction courses or a certain sample code.

I now make this publication with the apologies regarding the suspicious agreement of my language that I speak now toward your ears (although you are reading it, because you could not hear me, but if you do indeed hear me, you can ignore in this case, please this report to hear regarding me http://www.opengl.org/discussion_boards/ubb/smile.gif)

09-12-2002, 01:52 PM
i must say i would like to help you. however, i haven't got a clue what you are asking, although i very much like the way you said it anyhow. http://www.opengl.org/discussion_boards/ubb/smile.gif

could you maybe explain "summit" in other words?

09-12-2002, 02:00 PM
I is lucky that you wrote this mast and at least my mast is now recognized! Although I am not safe now, how to communiate this!

OK ONE. Summit: I want to say the points of the triangles. Each triangle has three points. Do they cover? Deeply thanks for my language still!

09-12-2002, 02:09 PM
i'm still not sure i understand - but if i understand right, you mean you have say 200 vertex positions, but say 320 unique normals and texture coordinates, because some vertices are used in different triangles?
is that it?
if so, you have to duplicate the vertex positions for those vertices, so you have for each vertex, one position, one normal, one texture coordinate (or whatever it is you need).
so you will have to change your "summits" (if you mean indices) for some triangles to use the new, duplicated, vertex positions so they get the right normals and texcoords.

am i on the right track?

you mean your lists of positions, normals, colors etc are different sizes, yes?

09-12-2002, 02:14 PM
I think I understand what you are trying to ask for...

You are wanting to use the glDrawElements routine to draw some triangles but it is asking you for same size information?

If this is the case then I assume the problem is to do with you not setting up the required arrays for the different elements of the triange such as Color, Normals and texture coordinates.

I haven't used this command myself but on locating information on it at :

It sounds like an interesting item to work with.

You may also want to look at http://www.movesinstitute.org/~mcdowell/mv4202/notes/lect14.pdf which seems to have some sample code you may be able to use.


09-12-2002, 02:16 PM
They struck that nail of the head. This is what the English word I think. The way that you are correct.

Now you can say a good code to me to make this. The example code would help me much!

For your information am I beginning with a certain document, like ASE.


09-12-2002, 04:49 PM
There's no law that says it's illegal to write in other languages.

SVP, Pose ta question en francais.


09-12-2002, 09:39 PM
I suppose what you are asking is how to specify the arrays of data (vertices, textcoords, normals, etc.) to use before calling glDrawElements.

First, you enable the arrays you want to use :


Then, you specify pointers to the data you want to use :

glVertexPointer(3, GL_FLOAT, 0, vertices); glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors);
glTexCoordPointer(2, GL_FLOAT, 0, textcoords);
glNormalPointer(3, GL_FLOAT, 0, normals);

where vertices, colors, textcoords and normals are pointers to your data.

Finally you call GlDrawElements :

glDrawElements(GL_TRIANGLES, num_indexes, GL_UNSIGNED_INT, indexes);

If you are looking for an OpenGL forum in french, you can try : http://www.linuxgraphic.org/

If I didn't understand your question, you can try in french, it's my mother tongue.

09-12-2002, 10:54 PM
Yeah, ask in French, because you do not make a lot of sense in English.. :)

Y'a beaucoup de Francais sur ce board?


09-13-2002, 12:25 AM
Y'a beaucoup de Francais sur ce board?Quelques uns semble-t-il ;-)

09-13-2002, 01:01 AM
Look here, I think you'll find everythings you need...

Sincerly yours,

PS : this is a joke : "If you don't reach your goal with this doc, do not try to code with OpenGL...!". ;-)

09-13-2002, 04:26 AM
I thank you everything to submit to me your suggestions to answer the question that I had said you that I just made a day ago.

I am likewise very lucky to experience that I am to be understood my seizure of the English for "Joe average" now rather well!

My English professor will be fast, in order to congratulate mine antics from donkey on thanks to this forum! It is the very inclination of the success set and the framing clip.