Deformation-Transfer-for-Triangle-Meshes
Deformation-Transfer-for-Triangle-Meshes copied to clipboard
The mesh position after deformation is far away from the reference mesh position.
Hi,
The mesh position after deformation is far away from the reference mesh position.
How can I deal with this problem?
Thanks.
Hi Owen, the authors of the paper state a solution: "In order to resolve the global positioning of the camel over time and to enforce foot/ground contact, we extracted the positions of one vertex on each foot of the horse over time, performed an overall scaling to better match the larger size of the camel, and added vertex constraints to match a vertex on each camel foot to these positions." [Ch.6 Sumner2004DTF by Sumner, Popović]
So basically it is up to the user to move the transformed mesh to a desired position.
corr_markers: List[(int,int)] = ... # List of vertex-id-tuples (source, target)
source: meshlib.Mesh = ...
pose: meshlib.Mesh = ...
target: meshlib.Mesh = ...
foot_marker: int = ???
source_height = source.vertices.T[2].max() - source.vertices.T[2].min()
target_height = target.vertices.T[2].max() - target.vertices.T[2].min()
scale: float = target_height / source_height
...
transf: Transformation = ...
result = transf(pose)
offset = pose.vertices[corr_markers[foot_marker][0]]] * scale - result.vertices[corr_markers[foot_marker][1]]
result.vertices += offset
Won't fix it in code, since it depends on the case.
Ok, I try this. Thank you.
Couldn't this be resolved by offsetting the vertices based on target's reference position of one of the markers? (That sounds like a pretty generalized solution)
I implemented such offsetting as well for a special use case in my fork, so seems a common requirement.