Hello,
I'm still loving pyglet but I'm running into trouble.
I'm using the following code to draw models I have stored in a
'vvvnnntttcccvvvnnnt....' format.
glBindBuffer(GL_ARRAY_BUFFER, self._data_buffer)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self._tri_buffer)
glEnableClientState(GL_VERTEX_ARRAY)
#glVertexPointer(3, GL_FLOAT, 12, POINTER(GLvoid(0))) #how do
i set up the offsets?
glVertexPointer(3, GL_FLOAT, 12*4, 0) # this can't be right
glEnableClientState(GL_NORMAL_ARRAY)
glNormalPointer(GL_FLOAT, 12*4, 3*4)
glEnableClientState(GL_TEXTURE_COORD_ARRAY)
glTexCoordPointer(3, GL_FLOAT, 12*4, 6*4)
glEnableClientState(GL_COLOR_ARRAY)
glColorPointer(3, GL_FLOAT, 12*4, 9*4)
glDrawElements(GL_TRIANGLES, self._tri_count, GL_UNSIGNED_INT,
0)
glDisableClientState(GL_VERTEX_ARRAY)
glDisableClientState(GL_NORMAL_ARRAY)
glDisableClientState(GL_TEXTURE_COORD_ARRAY)
glDisableClientState(GL_COLOR_ARRAY)
glBindBuffer(GL_ARRAY_BUFFER, 0)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)
I'd prefer to use the pyglet built-in system for vertex arrays / vbos.
But I don't quite see how to do it with my data format. I suppose I
could break the normals and vertexes into different lists but I'd like
to do it this way.
Can someone please show me how to do this correctly with pyglet?
--
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.