Hey, I am attempting to run my first script inside of wrapX and have a question about vertex # order.
I have used an outside 3d program to find vertex points (programmatically) for both my scan and target mesh. I saved these out to a txt file, in what I believe is the same way r3ds outputs them. That is [[vertexNumber, 0, 0]] I have no idea what the zero zero is for. Perhaps you can also go into detail about this?
Back on topic. So when wrapX imports my vertex txt file, all of my points are randomly placed onto my obj mesh. What do you think might be the issue here?
Actually I figured out that the txt is face numbers and not vertex numbers. So I converted my numbers to faces, and this worked for my scan mesh. Yay! However, when I did the same thing to my base mesh… I still have points randomly placed points across the mesh.
The thing is: in WrapX point correspondences can be specified at any point on the surface (not only at vertex positions). This allows to specify them very precisely inside any polygon according to texture features for example.
To specify position of the point on surface we use 3 values: triangleIndex, u, v.
First we triangulate mesh’s polygons using simple fan triangulation with the origin of the fan at first vertex of the polygon. The index of triangle where the point lays on is triangleIndex.
Second, we find barycentric coordinates of the point inside triangle. Given a triangle with vertices V1, V2, and V3, any point P on the plane of that triangle can be specified by three weighting factors u, v, and w, each of which indicates how much relative influence the corresponding triangle vertex contributes to the location of the point. If u >= 0 and v >= 0 and w >= 0 and u + v + w = 1 than point P is inside triangle. If, for example, u = 1 and v = 0 and w = 0 than point P is at vertex V1.
As we only deal with point inside triangle, i.e. u + v + w = 1, we only need u and v coordinates, as w = 1 - u - v.
Ahh triangulated, well now the confusion is cleared up. So my scan is triangulated, which that makes sense as to why when I switched to faces in my txt file it correctly selected inside of Wrapx. But obviously the base mesh is quads. Soo I suppose I can use wrap to find the points on the base mesh and save a file out for each mesh that I will be wrapping around my scan models.
Yeah I am using a self created, automatic point detection. Or at least I am hoping to
Thank you for the clear explanation, that was a huge help