Indexed Vertex Arrays, help me!!

Started by
1 comment, last by Snyper 23 years, 6 months ago
Ok i have a few quesions about Indexed Vertex Arrays. 1) How do i set the texture coords if i use Indexed Vertex Arrays? Using glDrawElements() of course. 2) If i load a model or even game map data like a quake map, how would i determine which verticies go into the array to be passed to glDrawElements()? 3) This question goes with #2, when i find out which verticies i need to use, do i just store them in a huge array like something[10000] or would i use a 'better' method? I just want to draw all my data like quake 3 does, John Carmack says 99% of all graphic data goes though glDrawElements(), and i want to do the same thing. Thanks for your help. -Snyper Edited by - Snyper on 10/6/00 4:01:48 PM Edited by - Snyper on 10/6/00 4:04:29 PM
=============================Where's the 'any' key?=============================
Advertisement
Gamedata, like a map, would most probably be put into a special data structure like a BSP tree (which is what ID games have being doing since Doom). Each leaf of the BSP tree would probably have an indexed array for glDrawElements, so you would basicaly have a bunch of data sets split up by poly order.
-----------------------------Mice are an excellent source of mice.
1/ exactlly the same way u set the vertex coords eg
glVertexPointer(..... vertices);
glTexCoordPointer(..... texcooords);
glDrawElements(......);
2/ this information should be in the model/map
3/ store the whole model/mesh in a array (it can be big) and just call various indices from it when u do a drawElements(..)

This topic is closed to new replies.

Advertisement