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 2 of 2

Thread: How to specify the size of an object [VBO] [Rendering]

  1. #1
    Newbie Newbie
    Join Date
    Mar 2014
    Posts
    2

    Question How to specify the size of an object [VBO] [Rendering]

    I have recently made the switch from OGL 1 to 3/4 rendering and have successfully created a VBO object complete with GLSL shaders but I have encountered a problem.

    I am drawing 2 Quads with glDrawArrays but OpenGL does not know where the vertices for the first quads ends meaning my problem is: GL treats the 2 Quads as just one objects and draws lines inbetween them - so my question is How can I tell opengl where each quad ends so it can draw them correctly.

    Thanks,
    GarryGL

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,215
    When rendering with GL_QUADS, each group of 4 verts defines a single quad (the end of each quad is implicit), and the count argument to glDrawArrays specifies the number of vertices.

    You may need to post a little code to illustrate your problem.

Posting Permissions

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