Skip to content
Snippets Groups Projects
Commit 2c5017f6 authored by Jakub Kolman's avatar Jakub Kolman
Browse files

[#123] feat: visualisation of rotated featurepoints

parent 9411d1ad
No related branches found
No related tags found
No related merge requests found
......@@ -106,8 +106,8 @@ public class ProcrustesAnalysis {
transformation.setRotationMatrix(this.rotate());
// move faces back to so the centroid of vertices is in the origin point
// moveFaceModel(faceModel1, new Vector3d(this.modelCentroid1.x, this.modelCentroid1.y, this.modelCentroid1.z));
// moveFaceModel(faceModel2, new Vector3d(this.modelCentroid1.x, this.modelCentroid1.y, this.modelCentroid1.z));
moveFaceModel(faceModel1, new Vector3d(this.modelCentroid1.x, this.modelCentroid1.y, this.modelCentroid1.z));
moveFaceModel(faceModel2, new Vector3d(this.modelCentroid1.x, this.modelCentroid1.y, this.modelCentroid1.z));
// readjustFace(faceModel2,
// new Vector3d(this.modelCentroid2.x, this.modelCentroid2.y, this.modelCentroid2.z),
......
......@@ -52,7 +52,9 @@ public class ProcrustesAnalysisFaceModel {
*/
public void setFeaturePointsMap(HashMap<Integer, FeaturePoint> featurePointsMap) {
this.featurePointsMap = featurePointsMap;
this.humanFace.setFeaturePoints(getFeaturePointValues());
readjustFeaturePoints(featurePointsMap);
// this.humanFace.setFeaturePoints(getFeaturePointValues());
}
public MeshModel getMeshModel() {
......@@ -125,4 +127,18 @@ public class ProcrustesAnalysisFaceModel {
return map;
}
private void readjustFeaturePoints(HashMap<Integer, FeaturePoint> featurePointsMap) {
this.humanFace.getFeaturePoints().forEach(fp -> {
FeaturePoint movedFp = featurePointsMap.get(fp.getFeaturePointType().getType());
if (fp.getFeaturePointType().getType()
!= movedFp.getFeaturePointType().getType()) {
throw new RuntimeException("Types do not correspond");
}
fp.getPosition().x = movedFp.getX();
fp.getPosition().y = movedFp.getY();
fp.getPosition().z = movedFp.getZ();
});
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment