convmesh
convmesh copied to clipboard
How do you derive the UV coordinate/coordinates for each vertex?
When I run the run_reconstruction.py for pascal cars, I notice the dimension of vertices is 962x3, but the dimension of UV coordinate is 1054x2. So the mapping between vertices and UV coordinate is not one-to-one.
- Which formula do you use to calculate UV coordinates for each vertex so that the mapping is not one-to-one?
- Which line of code can tell us the mapping between vertices and UV coordinate/coordinates?
I know why the dimension is 962 and 1054 respectively: north pole and south pole, have 32 corresponded UV points respectively, and each of 30 boundary vertices has two corresponded UV points. So the total UV points are 962 + 31*2 + 30 = 1054. For the second question, I also figured it out, topo_map is the one-to-one mapping between vertices and UV coordinates (but using averaged UV points for north pole, south pole, and 30 boundary vertices)
The remaining question is the first one.
Your observation about the boundary vertices is correct!
Regarding the mapping: you can find it in the .obj file of the mesh template. There is no formula, this is simply what Blender exports when you generate a UV sphere. Of course, it is also possible to derive such mapping programmatically: for the u coordinate, you quantize the angle uniformly between 0° and 360° (where 0° is 0 and 360° is 1), and v is the height. But this is unnecessary.