Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: to many glvertex3f statements

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    20

    to many glvertex3f statements

    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.

  2. #2
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005
    Location
    Iran
    Posts
    547

    Re: to many glvertex3f statements

    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-
    <span style="color: #006600">-Ehsan-</span>

  3. #3
    Junior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Re: to many glvertex3f statements

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •