On Feb 27, 9:38 pm, Jesse <[email protected]> wrote: > Hey all, > > Thought I'd take the weekend to learn a bit of OpenGL with pyglet, so I'm > working on a minecraft-like thingy. > > I'm trying to add a bunch of indexed vertex lists to a batch, but they seem > to be interfering with each other / sharing vertices across lists. Here's > the code:https://gist.github.com/79337c2249255207abad(ignore the terrible > world generation stuff please :) ) > > As-is, the code intentionally renders only the top faces of visible > cubes. It works fine (albeit slowly) if I put each list it its own group > (replace None on line 136 with pyglet.graphics.Group()) but I'm certain this > is an abuse of groups. > > My only lead is this presentation > (http://tartley.com/files/stretching_pyglets_wings/presentation/) which > claims that "vertex arrays passed to the creation of a batch need delimiting > with duplicated start and end vertices", but I can't find any code in the > wild that does this, and the docs don't mention this, except in the case of > the GL_TRIANGLE_STRIP mode etc. > > Any thoughts? Thanks for your help in advance. > > Jesse
Hey, The requirement to insert degenerate vertices only applies to GL_LINE_STRIP, GL_TRIANGLE_STRIP or GL_QUAD_STRIP primitives, so shouldn't be the cause of your problem here. Incidentally, I also found the docs for this hard to find - I guess I didn't know what I was googling for until after someone showed it to me. It's here on the API docs for the module pyglet.graphics, under 'Drawing Modes': http://www.pyglet.org/doc/api/pyglet.graphics-module.html When you say they are interfering with each other, what's the symptom precisely? Cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
