Re: [AD] 5.1? |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Trent Gamblin wrote:
On Mon, April 26, 2010 8:25 am, Pavel Sountsov said:Hmm, what do you mean by 'upgraded'? Are the 2D-only transform functions kept separate from the new 3D ones? Are the 3D functions inside the core?Right at the moment the 3d transform functions aren't exported, and they're in the core. Some of the 2D functions call the 3d functions. I found numerous, what I believe to be bugs, in the 2D transformations. The results of the iphone's rotation from portrait to landscape mode showed that the results from opengl's own calculations were much different from the transformation code in Allegro. As I said (or did I?) my transformation code is probably not optimal, as it doesn't multiply the matrix in place, but creates a temporary matrix and then calls al_transform_transform. The functions I can remember off the top of my head that produced different results from OpenGL were al_rotate_transform, al_transform_transform, and possibly al_translate_transform or others.
Hmm. I just did a few tests, and all of them came out to be positive. You sure you did not mix the 2D functions with anything 3D? Also, the order of transformations is different than in OpenGL.
It's a temporary solution, anyhow, as I never meant for the 3D transforms to be in the core.. but maybe they should be, if the 2D transforms are just 3D transforms with a fixed z value.
They are not. 2D transformations have no z coordinate. 2D transformations only touch the 2x2 corner and the 2x1 right column of the 4x4 matrix. This means that when they are used on anything that involves values outside that 2x3 region they will produce the wrong results.
Why are they laid out that way? Firstly, there's speed issues. E.g. al_transform_transform now needs 12 multiplies, while a full 3D one would need 27. Secondly, there's the point that A5 is a 2D library by default, and thus many bits of it (specifically the memory drawers both in the core and the primitives addon) just don't support it at this time. Primitives addon can be extended to handle them relatively easily, but the PARALLELOGRAM_MAP probably will need to be rewritten.
-SiegeLord
Trent :{)>
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |