Open GoogleCodeExporter opened 8 years ago
I am working on creating a 3d graphics engine and using the concepts behind
sprite.Sprite and the graphics.py demo to create a 3d set of primitive objects
(using pyglet 1.1.4 btw).
Now to implement picking I want to be able to change the group the primitive
belongs to. Based on sprite.Sprite, changing groups basically calls
self._batch.migrate(self._vertex_list, GL_QUADS, self._group, self._batch).
Note that self._vertexlist in sprite.Sprite is not an indexed list (see
Sprite._create_vertex_list). When I try to do the same thing with an indexed
vertexlist in my 3d engine I am getting some strange behavior. Looking at
Batch.migrate in pyglet\graphics\__init__.py it seems that the
batch._get_domain function is always called with False as the first argument,
indicating that it's a regular vertexlist. Therefore IndexedVertexList are not
supported as issue 603 mentions.
Taking a closer look at pyglet.graphics.vertexdomain revealed that
IndexedVertexLists do not have .migrate method overloaded to account for the
index buffer similar to .resize. I took the concepts in VertexList.migrate and
IndexedVertexList.resize and came up with the solution at the link provided
below. Here is the link to the repository and changes I made.
https://code.google.com/r/denisg640-pyglet/source/detail?r=f3d9a9a1e5d834731350e
fed71a606a807343768
Let me know if this solves issue 603.
Original comment by denisg...@gmail.com
on 28 Aug 2014 at 6:08
Version 1.1.4 is considered final, the development is happening in 1.2. I can
only suggest you to try 1.2 from repository and see if that works for you
(although it implies some API changes).
Original comment by useboxnet
on 31 Aug 2014 at 7:09
Original issue reported on code.google.com by
hugob...@gmail.com
on 28 Aug 2012 at 8:11