Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Texture mapping into a square.

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    5

    Texture mapping into a square.

    Hello,
    I have a 3D mesh of a face where I want to map it with a texture.
    I need to compute UV texture coordinates from the vertex coordinates.
    How can I compute these coordinates? and How can I do it with openGL?

  2. #2
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Location
    Innsbruck, Austria
    Posts
    281
    The texture coordinates come from the same source as the vertex coordinates. Your model file or wherever else your vertex data comes from.

    The texture coordinate is a vertex attribute. The veretx shader passes it to the fragment shader wich performs the texture lookup.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    5
    Quote Originally Posted by Agent D View Post
    The texture coordinates come from the same source as the vertex coordinates. Your model file or wherever else your vertex data comes from.

    The texture coordinate is a vertex attribute. The veretx shader passes it to the fragment shader wich performs the texture lookup.
    I am using OFF (Open File Format) files, where there is only vertex coordinates and face indices.
    So I have to compute the texture coordinates by my self.

  4. #4
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Location
    Innsbruck, Austria
    Posts
    281
    Do you mean this? It doesn't even store surface normals or indices. That's a pretty useless model file format.

    If you don't know preciesly what you are rendering and how it should be texture, I suggest using a better file format.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •