fix quat test try2

This commit is contained in:
treeform 2021-02-27 11:26:38 -08:00
parent 392b566351
commit 1a90fe6043

View file

@ -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()