[Interest] About the coordinator between the texture and vertex in opengl

Till Oliver Knoll till.oliver.knoll at gmail.com
Sat Dec 29 15:08:54 CET 2012



Am 29.12.2012 um 12:52 schrieb <song.7.liu at nokia.com>:

> ...
> The problem is about binding a texture to an object, but i am quite not understanding how is the texture coordinator decided according to the vertex coordinator ? 

Your question is indeed a little bit off-topic, but your assumption about OpenGL experts here on this list is probably true (disclaimer: it's been quite some while I did some OpenGL code, and that was back when OpenGL 1.4 was current, so "expert" doesn't necessarily include me ;)).

If you haven't done already study this example:

  http://doc.qt.digia.com/qt/opengl-textures.html

specifically

http://doc.qt.digia.com/qt/opengl-textures-glwidget-cpp.html

In GLWidget::makeObject you'll see how for every vertex (world coordinates are usually denoted as X, Y, Z) a corresponding texture coordinate (usually denoted U, V) is specified. That data is then passed on to OpenGL as array with glTexCoordPointer (the "non-OpenGL ES 2 code path") or as array attribute to the GL shader program.

Cheers,
  Oliver


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121229/1021f39e/attachment.html>


More information about the Interest mailing list