PDA

View Full Version : to many glvertex3f statements



ninjarider
08-03-2005, 11:23 AM
i have 10 pages of code with nothing but glvertex3f statements. it was 40 pages i reduced it by creating a list and using glcalllist. what would be a way to decrease the code even more.

once i can get some images for it its suppose to look like a race track.

Ehsan Kamrani
08-03-2005, 12:07 PM
Yes. You can reduce the code-Less then one page-and read the data from a text file. Most of the NeHe articles use from this manner: NeHe.gamedev.net
-Ehsan-

Hylke Donker
08-03-2005, 11:50 PM
You might wanna look at glDrawElements and glMultiDrawElements.
They use an array of indices to pick vertices from an vertex array.
This way you can use a vertex multiple times.