[A83] Re: Faster Multiplication


[Next][Index][Thread]

[A83] Re: Faster Multiplication





On Thu, 31 May 2001, Kirk Meyer wrote:

> Rotating in that manner is not feasible for 3D programs. Your rotation math
> is not accurate enough and after a while the numbers will degenerate and
> make the picture look funny. You have to store the X Y and Z rotation for
> all objects and rotate them those amounts each frame. Which requires O(n^3)
> multiplications as I mentioned earlier. For reference, see Matt Shepcar's
> Torus demo for the 86.

The O(n^3) may appear frightening, but consider what n refers to.  In the
context of matrix multiplication, this would be the size of the matrix.
However, if the rotation matrix is always 3x3 (or always 4x4) then this is
a constant, so I might as well say that each rotation required O(1)
multiplications which doesn't seem nearly as bad.

I also don't see why you consider the formulas given as being less
accurate, since each step is actually mathematically equivalent to
multiplying by the rotation matrix for that axis.  Then again, since you
are referring to degeneration "after a while" I might guess you were
talking about what would happen if the results of doing the rotation where
written over the original coordinates, but then again, the same problem
could happen if you rotated another way.

The thing that really seems strange to me, however, is why you would need
to use matrix multiplication in any case.  Even though the rotation matrix
is a matrix, points are usually vectors, so multiplying a point by your
rotation matrix would not be the multiplication of two matrices, but
instead of a matrix and a vector, requiring n^2 multiplications which is
in O(n^2) in the dimension of the matrix and vector (of course, you could
consider a vector to be an n by 1 matrix, but that doesn't change the
running time).

For these reasons, it actually seems that rotating a point using a
rotation matrix should take only 9 multiplications (which incidentally
would be better than the other method posted if using 3 axes, since it
would take 12 in this case).




Follow-Ups: