Archived

This topic is now archived and is closed to further replies.

Indexed Vertex Arrays, help me!!

This topic is 6278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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(..)

Share this post


Link to post
Share on other sites