Page 1 of 1
Math Library (with iqm animation demo)
Posted: Fri Oct 29, 2021 9:08 pm
by monolifed
https://github.com/monolifed/lua-module ... main/vmath (MIT Licensed)
Library is a port of my C library:
https://github.com/monolifed/vmath (Unlicense)
IQM animation demo is modified to use this library (replacing cpml)
Re: Math Library (with iqm animation demo)
Posted: Sun Oct 31, 2021 6:49 am
by Gunroar:Cannon()
Nice. It seems to have alot of stuff, that's good!
Re: Math Library (with iqm animation demo)
Posted: Sun Oct 31, 2021 11:34 am
by pgimeno
It's nice that this library uses numeric components instead of letters, and flat matrices instead of two-dimensional. Also nice that it returns values via modifying an argument. I've made work on a library that works this way, but the unit tests were too boring to write.
Typo:
Code: Select all
function quat.from_rot(r, v, a)
a = a / 2
local s = sin(a) / sqrt(v[1]^2 + v[2]^2 + v[3]^2)
r[1] = s * v[1]; r[2] = s * v[2]; r[3] = s * v[2]
Pay attention to r[3].
Re: Math Library (with iqm animation demo)
Posted: Sun Oct 31, 2021 1:57 pm
by monolifed
Thanks, there must be more typos and mistakes
It should have been function quat.from_rot(r, a, x, y, z) like (mat4.rv etc) to begin with