booglybob / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Possible problem in text_coords documentation #680

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using the current repository code:

print pyglet.image.ImageGrid(pyglet.image.load('tiles/tiles.png'), 2, 
2).get_texture().tex_coords

prints "(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0)"

However, in "http://www.pyglet.org/doc/programming_guide/opengl_imaging.html", 
we document that

"tex_coords is a 4-tuple of 3-tuple of floats; i.e., ..."

I'm not sure, but this seems to be inconsistent.

Original issue reported on code.google.com by jorgecar...@gmail.com on 9 Nov 2013 at 10:18

GoogleCodeExporter commented 8 years ago
From pyglet.image.Texture.__init__:

`tex_coords` : tuple
            12-tuple of float, named (u1, v1, r1, u2, v2, r2, ...).  u, v, r
            give the 3D texture coordinates for vertices 1-4.  The vertices
            are specified in the order bottom-left, bottom-right, top-right
            and top-left.

If you check the code in pyglet.image.Texture.blit, I think the programming 
guide is wrong (at least with 1.2 code):

http://pyglet-current.usebox.net/programming_guide/image.html#opengl-imaging

Original comment by useboxnet on 1 Dec 2013 at 8:45