Perry
Perry

Reputation: 1217

compare two 3Dmesh

I need to find an algorithm that with two 3D meshes (a set of points and triangles) checks if is possible find a matrix 4x4 that transform the first one in the second one. The matrix can contain scale, rotation and translation, and the order of points and the order of triangle can not be the same.

have someone already found a paper/article/accademic study about this problem?

Upvotes: 1

Views: 690

Answers (1)

Perry
Perry

Reputation: 1217

I thinked about this problem and I formulated this algorithm: To compare 2 mesh O1 and O2

  1. move both centre to origin, now we have T1 to apply to O1 and T2 to apply to O2 (I prefer this way instead of move only one object)
  2. take farther point of both mesh, F1 and F2 with distance d1 and d2 and set the scale of O2 as s2=d1/d2, now the 2 objects have the same size
  3. create a rotation (with a lookat algorithm) that makes F2 coincident with F1.
  4. take a point P1 in O1 as the only in the circle defined from his distance df1 from F1 and his distance from origin fp (it is a circle because it is the intersection of 2 spheres)
  5. find in O2 a point P2 with the same distances from origin and from F2 (now coincident with F1), if this point does not exist then the 2 objects are different.
  6. create a rotation along the axis Origin-F2 that makes P2 coincident with P1
  7. if for every point in O1 there is a point in O2 transformed that have the same position in O2 and for every triangle in O1 there is a triangle in the same position in O2 transformed

    then the 2 mesh are the same.

    else the 2 mesh are different.

Upvotes: 1

Related Questions