Dear Greg, many thanks for your reply and the explanatory references. I feel illuminated! Now I understand why my call self.batch.add(count,GL_TEXTURE_CUBE_MAP, None, ('v3f/static', vertex_data) demands a vertex list of 24 elements rather than 6.
On Friday, April 24, 2020 at 5:05:36 PM UTC+1, Nicky Mac wrote: > > I'm working with Python3.6 and Pyglet, Interested in displaying a very > large number of variously textured blocks in Minecraft style., I wondered > if using GL_TEXTURE_CUBE_MAP would improve performance compared to > rendering the 6 faces each time. Using cubemap (from > https://www.programcreek.com/python/example/97888/pyglet.gl) I created > my cubes and noted the returned identifiers. > Having studied the lists of CubeMap issues, I could not find any example > of such a cube actually being drawn *B*ewildered by the range of gl and > pyglet graphics calls possible, I still have no idea how to draw a textured > cube, I was excited to find that GL_TEXTURE_CUBE could be specified in > pyglet.graphics (tho not documented) but I can't get the draw to work. Here > is my relevant code and output: > > x, y, z = position > vertex_data = cube_vertices(x, y, z, 0.5) # create vertex list > glEnable(GL_TEXTURE_CUBE_MAP) > glBindTexture(GL_TEXTURE_CUBE_MAP, cubemap) # cubemap is the > textured-cube identifier > count = len(vertex_data) > pyglet.graphics.draw(count,GL_TEXTURE_CUBE_MAP, None, > ('v3f/static', vertex_data), ('t3f/static')) > > ('v3f/static', vertex_data), ('t3f/static')) > File "C:\Python\Python36\lib\site-packages\pyglet\graphics\__init__.py", > line 193, in draw > for format, array in data: > TypeError: 'NoneType' object is not iterable > -- 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 pyglet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyglet-users/2ea395a7-aefc-4007-813e-7b095b5f62bd%40googlegroups.com.