Results 1 to 2 of 2

Thread: Extracting points from GL_QAUD

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default Extracting points from GL_QAUD

    Dear Friends
    I have created a mesh(grid) using opengl's GL_QUAD option using glDrawElements() check below the code

    /////////////////////////////////////////////////////////////
    GLuint list = glGenLists(1);
    glNewList(list, GL_COMPILE);
    glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(2, GL_FLOAT, 0, vertices);
    glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
    glNewList(list, GL_COMPILE);
    glDrawElements(GL_QUADS, ptsInBlock*ptsInBlock*blocks*4, GL_UNSIGNED_INT, indices);
    glEndList();
    glDisableClientState(GL_VERTEX_ARRAY);
    //////////////////////////////////////////////////////////////

    Now I can see the elements on the screen. I want to do some operations on these elements so I need the information about each of these elements, i.e, I need the all 4 points coordinates for each of these elements.How can I retrive each element and all points coordinates.

    Any idea would be highly appreciated.[/B]

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Extracting points from GL_QAUD

    If you want the coordinates of the points before they are projected on the screen, grab a copy of the "vertices"-array. If you want the projected coordinates on the screen, see http://nehe.gamedev.net/data/article...asp?article=13
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Extracting text from QTableWidgetItem
    By bizmopeen in forum Newbie
    Replies: 3
    Last Post: 1st September 2009, 17:28
  2. Extracting strings in files
    By ComaWhite in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2008, 00:01
  3. Extracting xml fragment from QXmlStreamReader
    By Gopala Krishna in forum Qt Programming
    Replies: 5
    Last Post: 1st December 2007, 09:14
  4. Extracting current rotation
    By Gopala Krishna in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2007, 11:29
  5. Extracting text from QDomNodes
    By Matt Smith in forum Qt Programming
    Replies: 3
    Last Post: 25th February 2007, 20:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.