[A83] Re: Faster Multiplication
[Prev][Next][Index][Thread]
[A83] Re: Faster Multiplication
At 03:46 PM 5/31/01 -0600, you wrote:
>
>Division is not so essential for 3D. It is usually only performed when
>converting from real world to screen coordinates. The intensive portion of
>3D is the matrix multiplications. Matrix multiplications require O(n^3)
>multiplications. In 3D, rotation matrices are usually 4x4, although you can
>get by with 3x3. Therefore to manipulate a point requires 27
>multiplications. Now it is more easily seen why I wrote this fast
>multiplication routine. Multiplication is also useful in line clipping,
>another thing that shows up in 3D programs.
WIth a fast line routine and trig tables (not run-time calcing), you
canpull some decent wire-framing by these equations:
X Axis:
X'=Xcos(Tx)-Ysin(Tx)
Y'=Xsin(Tx)+Ycos(Tx)
Z'=Z
Y Axis:
X'=X
Y'=Ycos(Ty)-Zsin(Ty)
Z'=Ysin(Ty)+Zcos(Ty)
Z Axis:
X'=Zsin(Tz)+Xcos(Tz)
Y'=Y
Z'=Zcos(Tz)-Xsin(Tz)
So, for rotation about 1 axis, that's like 4 lookups, 4 mutiplications, and
2 add/subtracts. Not a lot of math for 1 point, but a beastly amount for a
lot of points. You could probably reduce the equations but bringing them
all together, and that couldg et some big speed gains with lotsof points.
Then all you need is fast, greyscale, fill, simply because flat fill in
black only is hard to see.
Follow-Ups:
References: