UV Mapping Algorithms

Started by
4 comments, last by Digitalfragment 12 years, 2 months ago
Hi,

Is there anyone who can guide me in the right direction (or article smile.png ). I want to generate UV mapping coordinates for my objects in code. So I would like to generate Plane, Box, Sphere, Cylinder etc. mapping for my objects in code. I am pretty sure there would be standartd algorithms out there to do this. I implemented my own algorithm for box mapping, but I am getting bad results on "edges" (where one vertex is projecting to one face of the box and the other vertex to the other face).

I included two images, one with the my generated mapping ("Incorrect Mapping.PNG") and one which it should look like and was generated by 3dsMax ("Correct Mapping.PNG").

Thanx in advance.
Advertisement
The second mapping has horrible seams, the texture doesn't match the UV coordinates.
Whatever UV coordinates you generate, you simply cannot expect to use the same generic texture for a sphere and a teapot.

Omae Wa Mou Shindeiru

Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.

Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.


No but when I use the UV's that were exported WITH Max, I get the same result as in Max (the desired result) on excactly the same mesh. So it is litteraly JUST the UV coordinates ons those edges that differ.
Have you tried scholar.google.com? Most of the time that I'm looking for a very mathy solution I can find something on there... I suspect that the solution will be found in topology papers, but you'll have to take a look around.

[quote name='Ashaman73' timestamp='1328271938' post='4909128']
Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.


No but when I use the UV's that were exported WITH Max, I get the same result as in Max (the desired result) on excactly the same mesh. So it is litteraly JUST the UV coordinates ons those edges that differ.
[/quote]

What ashaman was saying, is that in 3DSMax the vertices on the corners become unwelded, in order to have seperate UV coordinates. You will find that along those seams on the 3DSMax exported version of the file, there are infact at least 2 vertices for each of those points on the sphere, both have the same position & normal, but will have differing UV/Tangent/Binormal values.

Most UV unwrapping algorithms operate on each face as a unique surface, then re-weld vertices that are within tolerance (or the inverse, and break vertices whos tolerance from connected vertices diverges too much)

This topic is closed to new replies.

Advertisement