Results 1 to 4 of 4

Thread: Vertex Arrays

  1. #1
    Member Contributor
    Join Date
    May 2000
    Location
    St. John's, NF, Canada
    Posts
    50

    Vertex Arrays

    I am having a bit of trouble getting my head around vertex arrays. Basically i have this problem, I have an array of vertex information, so I Enable GL_VERTEX_ARRAY, then make my call to glVertexPointer().

    What I dont understand is where to go from there. This is because im loading data in from a file (about 4500 verts). I am unsure how to specify the Indices for each triangle from this data I have loaded.

    Thanks for any help
    Chris


    [This message has been edited by Whittick (edited 06-28-2000).]

  2. #2
    Member Contributor
    Join Date
    May 2000
    Location
    Ottawa, Ontario, Canada
    Posts
    75

    Re: Vertex Arrays

    Specifiy the indices same way you would if you had the vertices in an array already. The indices also go into an array, the indices in the sequence required to draw your triangles. E.G.
    GLubyte indices[]={0,1,2,0,2,3....
    glDrawElements(....indices)
    Hope that helps.

  3. #3
    Member Contributor
    Join Date
    May 2000
    Location
    St. John's, NF, Canada
    Posts
    50

    Re: Vertex Arrays

    Is there a way to generate this array from my data.

    The data is ordered sequencially, so there are some repeating vertices.

  4. #4
    Member Contributor
    Join Date
    May 2000
    Location
    Ottawa, Ontario, Canada
    Posts
    75

    Re: Vertex Arrays

    If I understand this correctly, you should load the array outside of your rendering loop, then access the array, probably in a display list, to construct your geometry, then call the display list in your rendering loop.
    pseudocode:
    read file and load array
    display list:construct geometry (using loaded array)
    rendering loop: call displaylist
    Am I in the ball park here?

Similar Threads

  1. arrays of arrays as vertex output/fragment input
    By tsojtsoj in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-17-2018, 08:02 PM
  2. Vertex Arrays, interleaved arrays, mouseMove func
    By Nibirue in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2012, 11:17 AM
  3. Big problem show arrays with vertex arrays
    By Rondey in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-15-2009, 10:09 AM
  4. Vertex Arrays: Interleaved or seperated arrays?
    By Jan in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 06-21-2005, 05:25 AM
  5. Vertex arrays and ... texture arrays
    By cix>foo in forum OpenGL: Advanced Coding
    Replies: 21
    Last Post: 06-25-2000, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean