|
From: Roger H. <rog...@mi...> - 2004-02-13 13:16:52
|
On Thursday, February 12, 2004, at 05:50 pm, Dair Grant wrote: >> You know, if you added a fourth redundant dimension to the Cartesian >> coordinate system, you could load points, vectors, etc. as true >> altivec >> vectors and perform a number of operations VERY quickly, albeit at the >> cost of some unused memory. Hmm... > > Right now QD3D vectors and colours are always three components. > > This is something we might want to change, or at least add the option > that you can specify points as quads and colours as argb (rather than > distinct diffuse colour + diffuse transparency colour). I may be saying the obvious as we are all at different points in out understanding of graphics/coordinate geometry, but when I saw the AltiVec specification I thought it was ideal for 3D work because a 3D vector has an implied Z of zero and a point has an implied Z of one. If you do a matrix multiply by a vector the bottom ( translation ) row gets multiplied by zero and has no effect whilst for a point it gets multiplied by one and added on. If you take the average of a number of points their Zs get added together and normally you divide by the number of points, bringing the Z back to one. Of course the implied divide by Z does it for you anyway. The other advantage is that C typing does not get in the way. For points, ( A + B ) / 2 is not normally allowed, though you can do A + ( B - A ) / 2 using standard routines as B - A gives a vector. Using 4 coordinates, point = point + vector also works automatically as lots of other stuff. Do we really need point3D and vector3D on the G4? I don't think so unless we have millions of them to pack into as small a space as possible. Of course we have to make it all work on other machines, like G3 too in a transparent way and that's the challenge. Roger. |