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
    Senior 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
    Senior 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.

Similar Threads

  1. Square Texture over a Circle
    By sunkingac in forum OpenGL ES
    Replies: 1
    Last Post: 01-06-2010, 05:09 PM
  2. cannot load non-square image as texture!
    By imported_billconan in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 09-29-2006, 03:11 AM
  3. Square texture doesnt fit to square plane.
    By tiregarfio in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-03-2006, 03:09 AM
  4. Mapping a giant, non-square texture onto a sphere?
    By balt in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-15-2005, 07:04 AM
  5. clicking a square mesh and printing the value of the square
    By iris_raj in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-21-2004, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean