• Advertisement
Sign in to follow this  

UV Mapping Algorithms

This topic is 2173 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

Is there anyone who can guide me in the right direction (or article [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ). 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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.
[/quote]

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='G-Man9566' timestamp='1328276159' post='4909150']
[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.
[/quote]

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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement