I managed to get gldrawelements in a similiar fashion:
self.cverts = ascontiguousarray(self.vertarray)
self.indices = array(range(4*40), dtype=int32)
self.cindices = ascontiguousarray(self.indices)
#glDrawArrays(GL_QUADS,0,4*50)
glDrawElements(GL_QUADS, len(self.indices), GL_UNSIGNED_INT,
self.cindices.ctypes.data_as(ctypes.POINTER(ctypes.c_int)) )
this works, and now I would like to try vbo's, but that can wait.
this get's ugly pretty soon and it seams this is the kind of tasks
pyglet should help with.
I'm using pyglet.graphics.draw_indexed now, but probably pyglet must
parse my lists at each frame.
Could someone point me to some examples of using for example an
IndexedVertexList?
I imagine I could create it once, and just call it's draw() method.
To drag the numpy thread a bit more:
What is the suggested approach to dealing with flattening lists? I
want my vertices as an array of arrays so I can use
all the vector operations on them, at the same time pyglet want's a
flat list.
If reshape it for the VertexList creation, can I reshape it back and
modify it's .vertices property without breaking anything?
--
best regards,
grzes
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---