简体   繁体   中英

Offset in glDrawElements using LWJGL

I'm trying to render only some of the Indices stored in the index buffer of an VAO.

glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, 0);

I know that the second parameter is the count of vertices to draw, in this case one triangle and the last parameter is the offset as a pointer. But how do I specify this pointer using LWJGL/Java?

Oh. I just have to specify the offest in bytes. I use floats, so to start at the scond triangle I would have to set the last parameter to 3 * 4.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM