Re: [AD] matrix_to_quat and get_align_matrix |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] matrix_to_quat and get_align_matrix
- From: Elias Pschernig <allefant@xxxxxxxxxx>
- Date: Mon, 18 Oct 2004 16:01:49 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=lRhHTpg8sFsQf/ULQkW5BZs7pnJna8n7ilP7lFKEqLhfQGqgonkbfv+f2dlids7oLQMgEkws+OsXhTo7FVAk+CmUPJjL4U2E/8zSiM1sCt7QXvaOSYGbGvdAo+0tlSq1s8wG15xCd2d/9Q47LvnlfZbIk007aATyjIFgP/KXGsg
To make this last point clear, here another testcase (using the same
print functions from above):
int
main (void)
{
MATRIX_f m;
allegro_init ();
/* Rotate 90 degree to the right around the y axis. */
get_rotation_matrix_f (&m, 0, -64, 0);
print_matrix (&m);
/* Get a matrix with the front vector looking along the positive x
* axis, and the up vector along the positive y axis. */
get_align_matrix_f (&m, 1, 0, 0, 0, 1, 0);
print_matrix (&m);
}
As you can see, both matrixes are the same, just one value is negated.
This means, the latter matrix isn't a rotation matrix anymore (I
think). At least, nothing works with it.
Instead of swapping the order in the cross_product calls, it can also
be solved by flipping the resulting "front vector". When thinking
about it, I don't even know what a "front vector" is supposed to be..
maybe I just misunderstand the function.