Test cleanup.

This commit is contained in:
treeform 2020-11-12 10:11:07 -08:00
parent 7991cea91e
commit 58db254ebe
3 changed files with 35 additions and 16 deletions

View file

@ -1040,3 +1040,21 @@ q(0.88595670, 0.46237046, 0.02352080, -0.02722242)
0.00000, 0.00000, 0.00000, 1.00000]
# matrix to quat test
# matrix to quat test
# matrix to quat test
Test Mat3 * Mat3:
[1.0000, 0.0000, 0.0000,
0.0000, 1.0000, 0.0000,
50.0000, 50.0000, 0.0000]
[1.0000, 0.0000, 0.0000,
0.0000, 1.0000, 0.0000,
50.0000, 50.0000, 1.0000]
[300.0000, 360.0000, 420.0000,
660.0000, 810.0000, 960.0000,
1020.0000, 1260.0000, 1500.0000]
[300.0000, 360.0000, 420.0000,
660.0000, 810.0000, 960.0000,
1020.0000, 1260.0000, 1500.0000]
Test Mat3 * Vec2 and Vec3:
(50.00000000, 50.00000000, 1.00000000)
(50.0000, 50.0000)
(50.00000000, 50.00000000, 1.00000000)

View file

@ -221,6 +221,23 @@ 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)
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 "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()
let (outp, _) = execCmdEx("git diff tests/test-output.txt")

View file

@ -1,16 +0,0 @@
import vmath
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)
echo "Test Mat3 * Mat3:"
echo (a3.mat4 * b3.mat4).mat3
echo a3 * b3
echo (mat3(1,2,3,4,5,6,7,8,9).mat4Rotation * mat3(10,20,30,40,50,60,70,80,90).mat4Rotation).mat3Rotation
echo mat3(1,2,3,4,5,6,7,8,9) * mat3(10,20,30,40,50,60,70,80,90)
echo "Test Mat3 * Vec2 and Vec3:"
echo a3.mat4 * vec3(77.64571380615234, 0, 1)
echo a3 * vec2(77.64571380615234, 0)
echo a3 * vec3(77.64571380615234, 0, 1.0)