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/47e3a622-d949-4076-b83a-afad3d6b89d7%40googlegroups.com.

Reply via email to