I believe drawing a line of width w is equivalent to drawing a "thin rectangle" of width w, and those can definitely be put into the same Batch. That is, replace each line segment with a quad, whose corners can be computed from w and the original line segment endpoints.
- Bruce On Mon, Apr 27, 2009 at 12:38 PM, Woodwolf <[email protected]> wrote: > > Hello! > > I'm trying to draw certain objects made of ten line segments. I have > used batched lines before, but now I need to use gl.glLineWidth to > change each segment's width. I have no idea how to use batch with this > constraint, and I'm not even sure if it's possible, due to OpenGL > states being involved (right?) > > Thus, I'm simply drawing lines with graphics.draw, which is quite > slow. Something like this: > > for c in range (0, n_sements): > ....gl.glLineWidth (1.0 + n_segments-c) # change line width > ....posA = self.pos[segment][c]["pA"]] # get segmet extrema. > ....posB = self.pos[segment][c]["pB"]] > ....graphics.draw(2, gl.GL_LINES, ('v2f', (posA[0], posA[1], posB[0], > posB[1]))) #draw :( > > Any help would be appreciated. Thanks! > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
