import pyglet
from pyglet.gl import *
if __name__ == '__main__':
display = pyglet.window.Window(400, 400)
domain = pyglet.graphics.vertexdomain.create_domain('v2i/stream', 'c4b/stream')
vertex_list = domain.create(4)
vertex_list.vertices = [50, 50, 50, 100, 100, 100, 100, 50]
vertex_list.colors = [
255, 255, 255, 255,
255, 0, 0, 255,
0, 255, 0, 255,
0, 0, 255, 255
]
@display.event
def on_draw():
display.clear()
pyglet.graphics.draw(1, GL_POINTS, ('v2i',(10,20)))
domain.draw(GL_POINTS)
pyglet.app.run()
I might be reading the opengl docs wrong (and I'm not familiar with vertexdomains) but don't you need normals, or a shader as well/instead ?
--
You received this message because you are subscribed to a topic in the Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyglet-users/WRLoiTtztqM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyglet-users...@googlegroups.com.
To post to this group, send email to pyglet...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Hi Josh,
There is a typo with the vertex color type. It looks like you want to use 8bit values, so If you change c4b to c4B it should work.
By the way, is there a specific reason you're using Domains directly, instead of just creating a Batch? There is nothing wrong with your approach, but using a Batch might save a bit of boilerplate.