Jump to content

  • Log In with Google      Sign In   
  • Create Account


UV Mapping Algorithms


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 G-Man9566   Members   -  Reputation: 122

Like
0Likes
Like

Posted 03 February 2012 - 01:47 AM

Hi,

Is there anyone who can guide me in the right direction (or article Posted Image ). 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.

Attached Thumbnails

  • Incorrect Mapping.PNG
  • Correct Mapping.PNG


Sponsor:

#2 LorenzoGatti   Crossbones+   -  Reputation: 2314

Like
-2Likes
Like

Posted 03 February 2012 - 05:17 AM

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.
Produci, consuma, crepa

#3 Ashaman73   Crossbones+   -  Reputation: 5906

Like
0Likes
Like

Posted 03 February 2012 - 06:25 AM

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.

#4 G-Man9566   Members   -  Reputation: 122

Like
0Likes
Like

Posted 03 February 2012 - 07:35 AM

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.

#5 Jason Z   Crossbones+   -  Reputation: 3780

Like
0Likes
Like

Posted 03 February 2012 - 01:37 PM

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.

#6 Digitalfragment   Members   -  Reputation: 632

Like
0Likes
Like

Posted 05 February 2012 - 07:17 PM


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.


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)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS