On 30/10/14 14:18, 'paeron' via pyglet-users wrote:
Hey everyone!
Hoping to get some help with my problem here.
Im drawing a hexagonal-grid with batches.
I've got an Hexagon class with init as following. Im passing along a
batch because I taught it would be nice to add all my hexagons to a
single batch.
|
class Hexagon(object):
def __init__(self, x, y, size, batch, color):
...
|
After all the math I have a tuple with the vertices and adds it to the
batch
|
self.batch.add(
6,
GL_LINE_LOOP,
None,
('v2f', vertices_tuple),
('c3f', color * 6)
)
|
When this gets drawn to the screen I get this:
<snip>
If I create a new batch for each hexagon and fill it with the exact
same values and later loop over all the hexagons and draw their batches.
I get the following:
<snip>
I hope Ive described the problem well enough and looking forward to
any help!
/ BR Tommy
As the documentation at
http://pyglet.org/doc-current/api/pyglet/pyglet.graphics.html#module-pyglet.graphics
says:
"However, because of the way the graphics API renders multiple
primitives with shared state, GL_POLYGON, GL_LINE_LOOP and
GL_TRIANGLE_FAN cannot be used — the results are undefined."
There is a work around and an alternative on that page.
HTH,
Adam.
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.