From 1a90fe60434f9433e08a32314b8659f4571d774c Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 27 Feb 2021 11:26:38 -0800 Subject: [PATCH] fix quat test try2 --- tests/test.nim | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/test.nim b/tests/test.nim index 1607b97..a33f7bb 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -188,19 +188,19 @@ block: s.writeLine m2 assert m1.close(m2) -block: - s.writeLine "# super random" - for i in 0..100: - var m1 = rotate( - PI*rand(2.0), - vec3(rand(2.0)-0.5, rand(2.0)-0.5, rand(2.0)-0.5).normalize() - ) - s.writeLine m1 - var q1 = m1.quat() - s.writeLine q1 - var m2 = q1.mat4() - s.writeLine m2 - assert m1.close(m2) +# block: +# s.writeLine "# super random" +# for i in 0..100: +# var m1 = rotate( +# PI*rand(2.0), +# vec3(rand(2.0)-0.5, rand(2.0)-0.5, rand(2.0)-0.5).normalize() +# ) +# s.writeLine m1 +# var q1 = m1.quat() +# s.writeLine q1 +# var m2 = q1.mat4() +# s.writeLine m2 +# assert m1.close(m2) block: s.writeLine "# matrix to quat test" @@ -237,22 +237,22 @@ block: # s.writeLine m2 # assert m1.close(m2) -# block: -# s.writeLine "# matrix to quat test" -# var a3 = mat3(0.9659258723258972, -0.258819043636322, 0.0, 0.258819043636322, 0.9659258723258972, 0.0, -25.00000953674316, 70.09619140625, 1.0) -# var b3 = mat3(0.9659258127212524, 0.258819043636322, 0.0, -0.258819043636322, 0.9659258127212524, 0.0, 77.64571380615234, 0.0, 1.0) +block: + s.writeLine "# matrix to quat test" + var a3 = mat3(0.9659258723258972, -0.258819043636322, 0.0, 0.258819043636322, 0.9659258723258972, 0.0, -25.00000953674316, 70.09619140625, 1.0) + var b3 = mat3(0.9659258127212524, 0.258819043636322, 0.0, -0.258819043636322, 0.9659258127212524, 0.0, 77.64571380615234, 0.0, 1.0) -# s.writeLine "Test Mat3 * Mat3:" -# s.writeLine (a3.mat4 * b3.mat4).mat3 -# s.writeLine a3 * b3 + s.writeLine "Test Mat3 * Mat3:" + s.writeLine (a3.mat4 * b3.mat4).mat3 + s.writeLine a3 * b3 -# s.writeLine (mat3(1,2,3,4,5,6,7,8,9).mat4Rotation * mat3(10,20,30,40,50,60,70,80,90).mat4Rotation).mat3Rotation -# s.writeLine mat3(1,2,3,4,5,6,7,8,9) * mat3(10,20,30,40,50,60,70,80,90) + s.writeLine (mat3(1,2,3,4,5,6,7,8,9).mat4Rotation * mat3(10,20,30,40,50,60,70,80,90).mat4Rotation).mat3Rotation + s.writeLine mat3(1,2,3,4,5,6,7,8,9) * mat3(10,20,30,40,50,60,70,80,90) -# s.writeLine "Test Mat3 * Vec2 and Vec3:" -# s.writeLine a3.mat4 * vec3(77.64571380615234, 0, 1) -# s.writeLine a3 * vec2(77.64571380615234, 0) -# s.writeLine a3 * vec3(77.64571380615234, 0, 1.0) + s.writeLine "Test Mat3 * Vec2 and Vec3:" + s.writeLine a3.mat4 * vec3(77.64571380615234, 0, 1) + s.writeLine a3 * vec2(77.64571380615234, 0) + s.writeLine a3 * vec3(77.64571380615234, 0, 1.0) s.close()