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: How to get vertexes from OpenGL

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    1

    Question How to get vertexes from OpenGL

    Hello. I have two intersecting meshes (for examle cube and cylinder) consisting of triangles and I have list of triangle's vertexes.
    After executing subtraction procedure (using depth test) and rendering I have a new mesh, but I don't know it's triangles's count and vertexes. I just have a rendered image of a new object.
    The question is how to get all information about this new object? I tried to use feedback rendering mode, but in feedback buffer I found all two meshe's triangles, even invisible one.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    894
    You can read the contents of a variety of buffer by simply mapping it to client space using glMapBuffer(). On the part of doing CSG kind of stuff with transform feedback I'm not sure. I don't think this is the way it can be done.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421
    Quote Originally Posted by HMD_Dmitry View Post
    Hello. I have two intersecting meshes (for examle cube and cylinder) consisting of triangles and I have list of triangle's vertexes.
    After executing subtraction procedure (using depth test) and rendering I have a new mesh, but I don't know it's triangles's count and vertexes. I just have a rendered image of a new object.
    The question is how to get all information about this new object? I tried to use feedback rendering mode, but in feedback buffer I found all two meshe's triangles, even invisible one.
    Sounds like you want CSG - constructive solid geometry. You would need to use a 3rd party library or write your own CSG code.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

Posting Permissions

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