Results 1 to 3 of 3

Thread: Does Open GL support vertex group referencing?

  1. #1
    Member Contributor
    Join Date
    May 2012
    Posts
    51

    Does Open GL support vertex group referencing?

    hi

    Does Open GL support vertex group referencing like Direct X does? This is to say if a vertex array group of position coordinates, texture coordinates and normal coordinates is stored in a "struct" array(or equivalent) could Open GL support a an indice list used to locate a vertex group.

    <<E.G.>>
    Code :
    struct VertexType
    {D3DXVECTOR3 position;
    D3DXVECTOR2 texture;
    D3DXVECTOR3 normal;
    };
     
    //Vertex group array
    VertexType * vertices;

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Does Open GL support vertex group referencing?

    Yes, it's called "interleaved attribute arrays", and you don't need special functions to use them. Just reuse the same VBO (same glBindBuffer call) and supply different offset per attribute, while specifying stride.

  3. #3
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: Does Open GL support vertex group referencing?

    The simplest way to do what you have described is to use glInterleavedArrays.
    This is now considered legacy/depreciated in OpenGL but if you are using compatibility profile then it's perfectly fine.
    The great thing about this is its simplity.
    GL_V2F, GL_V3F, GL_C4UB_V2F, GL_C4UB_V3F, GL_C3F_V3F, GL_N3F_V3F, GL_C4F_N3F_V3F, GL_T2F_V3F, GL_T4F_V4F, GL_T2F_C4UB_V3F, GL_T2F_C3F_V3F, GL_T2F_N3F_V3F, GL_T2F_C4F_N3F_V3F, and GL_T4F_C4F_N3F_V4F are accepted as data formats - which gives quite a bit of flexibity.

    For your needs GL_T2F_N3F_V3F is the one to go for, so a struct like the following would be required:
    {
    float[2] Texture coords;
    float[3] Normal;
    float[3] Vertex;
    }

Similar Threads

  1. intel support for open cl
    By snort.ips in forum OpenCL
    Replies: 5
    Last Post: 06-01-2011, 03:01 PM
  2. open glsl support?
    By NeverSayImpossible in forum OpenGL: GLSL
    Replies: 4
    Last Post: 03-17-2011, 12:12 AM
  3. Replies: 5
    Last Post: 03-16-2011, 12:33 PM
  4. Do Vertex Array Objects 'group' also glUniform?
    By imported_tobindax in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-23-2011, 07:45 AM
  5. Replies: 1
    Last Post: 08-02-2005, 01:20 PM

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