cnr-isti-vclab / meshlab

The open source mesh processing system
http://www.meshlab.net
GNU General Public License v3.0
4.75k stars 823 forks source link

how to use meshlap generate uv texture map? #1211

Open mrlihellohorld opened 2 years ago

mrlihellohorld commented 2 years ago

Hi, I'm appreciate to your great work! I converted lego_lowres.ply to lego_lowres.obj, then import lego_lowres.obj to ue4. The color of the model cannot be seen in ue4, so a uv texture map needs to be generated. I try to generate texture map using meshlab by Converting color point cloud to textured mesh. I refer to this tutorial:https://www.youtube.com/watch?v=6wP_e37t7PI and https://stackoverflow.com/questions/47693251/how-to-convert-a-colored-point-cloud-into-a-textured-mesh. But what I get is not good. Open the lego_lowres.ply file with meshlab as shown below. image and then I generate the texture map through the above method as shown in the figure below: image Then I linked the texture map to ue4 as shown below. image There is a big gap between the effect after linking the texture map and the opening with meshlab. Do you have any suggestions? Thank you very much!! I did some experiments. For example, I followed the steps below to generate a texture map as shown in the figure below: “If you want a texture, you first need UV coordinates - the easiest and messiest way for an arbitrary mesh is to do Filters -> Texture -> Parameterization: Trivial per triangle, then use Filters -> Texture -> Transfer: Vertex Attributes to Texture. This can cause seams to appear. For my messy meshes I use the Smart UV in Blender and export it out as a .obj, then import it into meshlab and use the aforementioned Transfer: Vertex Attributes to Texture filter.” from https://stackoverflow.com/questions/47693251/how-to-convert-a-colored-point-cloud-into-a-textured-mesh. image When I link this texture map to ue4, the effect is as shown below image

RealityTracer commented 1 year ago

The quality of a textured mesh depends on UV coords of verts in one or more texture maps. Often, A texture map is an image with size of power of 2, which is generated by using some atlas methods. The key is to generate the texture map and compute the vert texcoords or wedge texcoord according to your atlas methods. It's important to note that the minimal unit in a texture map is for a primitve, a series of adjacent faces also can relate to a relatively successive texels. Based on your figures, it seems that some errors result from texture maps and coords. In a word, it is a challenging job.