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 5 of 5

Thread: calculating UV coordinates of arbitrary meshes

  1. #1
    Intern Contributor
    Join Date
    Mar 2011
    Location
    Israel
    Posts
    53

    calculating UV coordinates of arbitrary meshes

    Hi all. I am generating planar meshes from 2d splines. I have an issue with UV generation for the vertices so that the textrue would not look distorted. That is because the triangles are not uniform across the surface. Anyone can point out to relevant algorithms ,code samples or any other referencesrefer which deal with this problem.
    Thanks for help in advance.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: calculating UV coordinates of arbitrary meshes

    The texture is going to be distorted, one way or another. There's no way to map a square onto an arbitrarily curved 2D surface without distortion. You can't just throw any image onto any surface and expect it to work.

    What you need to do is have your textures be designed *for* the distortion. You need to have your textures built around the mapping. That's why being a texture artist is hard.

  3. #3
    Intern Contributor
    Join Date
    Mar 2011
    Location
    Israel
    Posts
    53

    Re: calculating UV coordinates of arbitrary meshes

    Sorry, let me explain myself.What I mean is that the mesh is flat- planar.
    There are no extrusions along the Y (up) . In 3DS Max and in other visual packages you can see the spline shapes triangulated and then after applying planar UV mapping the textures look just fine. That is what I need basically.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099

    Re: calculating UV coordinates of arbitrary meshes

    If you can have a DDC tool create correct UVs, why don't you use the same coordinates with OpenGL?

  5. #5
    Intern Contributor
    Join Date
    Mar 2011
    Location
    Israel
    Posts
    53
    Quote Originally Posted by thokra View Post
    If you can have a DDC tool create correct UVs, why don't you use the same coordinates with OpenGL?
    I am generating a planar mesh in procedural way. It may have a varying number of segments and vertices.But never mind ,I have found the solution .

Posting Permissions

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