Results 1 to 2 of 2

Thread: Efficiency: Vertex arrays

  1. #1
    Member Contributor
    Join Date
    Nov 2002
    Posts
    96

    Efficiency: Vertex arrays

    I got my book this Saturday (the one from Gamedev.net) and I've been reading over vertex arrays for a while now.
    What I've been wondering how I can best render/store an object that consists out of different primitives (QUADS or TRIANGLES or POLYGON). I've been thinking of making a whole set of different arrays in my object (one for QUADS, one for TRIANGLES, etc etc) but I'm not quite sure this is the most efficient or even most understandable way to do this. Any suggestions on this?

    Also doesn't the book mention the use of the index array (I read about that in some other thread) but it does seem to be in their example code. Can anyone provide me with an clear example of how to use it most efficiently?

    Thank you!

    [EDIT]
    And how can I define the size of an array in an object AFTER I have made it, I now have to define the size of the array in the definition of the object... I currently use vectors to get around this problem
    [/EDIT]

    [This message has been edited by Structural (edited 12-02-2002).]

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    Melbourne, Australia
    Posts
    224

    Re: Efficiency: Vertex arrays

    I got my book this Saturday (the one from Gamedev.net) and I've been reading over vertex arrays for a while now.
    What I've been wondering how I can best render/store an object that consists out of different primitives (QUADS or TRIANGLES or POLYGON). I've been thinking of making a whole set of different arrays in my object (one for QUADS, one for TRIANGLES, etc etc) but I'm not quite sure this is the most efficient or even most understandable way to do this. Any suggestions on this?
    I see no reason why you would like to have so many representations of your geometry at the same time.


    Also doesn't the book mention the use of the index array (I read about that in some other thread) but it does seem to be in their example code. Can anyone provide me with an clear example of how to use it most efficiently?
    Indexed arrays representation usually needs less memory, since common verts can be reused for many polys.

    Quake3 BSP for instance uses geometry representation where verts are stored in triangle-fan-like order (GL_TRIANGLE_FAN), but elements point to verts in triangle-like order.
    This way however they don't reuse verts, so they need to send more data to card (Hmmm...why they choosed this way then??).


    And how can I define the size of an array in an object AFTER I have made it, I now have to define the size of the array in the definition of the object... I currently use vectors to get around this problem
    LOL , code:
    float* values;
    values = new float[number_of_values];

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 Operations- efficiency
    By Decoder4TheCode2 in forum OpenGL: Advanced Coding
    Replies: 14
    Last Post: 03-18-2012, 07:18 AM
  3. Vertex Arrays, interleaved arrays, mouseMove func
    By Nibirue in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2012, 11:17 AM
  4. Big problem show arrays with vertex arrays
    By Rondey in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-15-2009, 10:09 AM
  5. Vertex Arrays: Interleaved or seperated arrays?
    By Jan in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 06-21-2005, 05:25 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