Skip to content
Snippets Groups Projects
Commit c8298568 authored by Mária Kocúreková's avatar Mária Kocúreková
Browse files

ICP with Point3d

parents 4f2204d5 1d9816fc
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ import cz.fidentis.analyst.visitors.mesh.HausdorffDistance; ...@@ -7,6 +7,7 @@ import cz.fidentis.analyst.visitors.mesh.HausdorffDistance;
import javax.vecmath.Matrix4d; import javax.vecmath.Matrix4d;
import javax.vecmath.Point3d; import javax.vecmath.Point3d;
import javax.vecmath.Vector3d; import javax.vecmath.Vector3d;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
......
...@@ -128,6 +128,7 @@ public final class Quaternion { ...@@ -128,6 +128,7 @@ public final class Quaternion {
* @return a rotation matrix (4x4) * @return a rotation matrix (4x4)
*/ */
public Matrix4d toMatrix(){ public Matrix4d toMatrix(){
<<<<<<< HEAD
double xx = x * x; double xx = x * x;
double xy = x * y; double xy = x * y;
double xz = x * z; double xz = x * z;
...@@ -142,6 +143,22 @@ public final class Quaternion { ...@@ -142,6 +143,22 @@ public final class Quaternion {
2 * ( xy - zw ), 1 - 2 * ( xx + zz ), 2 * ( yz + xw ), 0, 2 * ( xy - zw ), 1 - 2 * ( xx + zz ), 2 * ( yz + xw ), 0,
2 * ( xz + yw ), 2 * ( yz - xw ), 1 - 2 * ( xx + yy ), 0, 2 * ( xz + yw ), 2 * ( yz - xw ), 1 - 2 * ( xx + yy ), 0,
0, 0,0, 1); 0, 0,0, 1);
=======
double xx = x * x;
double xy = x * y;
double xz = x * z;
double xw = x * w;
double yy = y * y;
double yz = y * z;
double yw = y * w;
double zz = z * z;
double zw = z * w;
return new Matrix4d(1 - 2 * ( yy + zz ),2 * ( xy + zw), 2 * ( xz - yw),0,
2 * ( xy - zw ), 1 - 2 * ( xx + zz ), 2 * ( yz + xw ), 0,
2 * ( xz + yw ), 2 * ( yz - xw ), 1 - 2 * ( xx + yy ), 0,
0, 0,0, 1);
>>>>>>> 1d9816fc2b5d38ad345c195f2913fb8adf5a5de1
} }
} }
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