Math Library (with iqm animation demo)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Math Library (with iqm animation demo)

Post 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)
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Math Library (with iqm animation demo)

Post by Gunroar:Cannon() »

Nice. It seems to have alot of stuff, that's good! :awesome:
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Math Library (with iqm animation demo)

Post 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].
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: Math Library (with iqm animation demo)

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 61 guests