Dear John,
Am 09.10.13 07:28, schrieb John Nagle:
if you can discard the last element, the matrix has a special structure:
It is an affine transform, where the last row is unity, and it can be
rewritten as
A*x+b
where A is the 3x3 upper left submatrix and b is the column vector. You
can do this by simple slicing - with C as the 4x4 matrix it is something
like
dot(C[0:3, 0:3], x) + C[3, 0:3]
(untested, you need to check if I got the indices right)
*IF* however, your transform is perspective, then this is incorrect -
you must divide the result vector by the last element before discarding
it, if it is a 3D-point. For a 3D-vector (enhanced by a 0) you might
still find a shortcut.
Christian