Re: [AD] 5.1?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, Apr 27, 2010 at 12:46 AM, Trent Gamblin <trent@xxxxxxxxxx>
wrote:

On Mon, April 26, 2010 4:11 pm, Elias Pschernig said:
> What are the drawbacks of removing parallelogram_map completely?

That function is the greatest evil in all of Allegro... but it works
and is
decently fast... But IMO if it can be rewritten more clearly that
would be
great.

That wouldn't help with the code duplication and the transformation
issue at all so not too much point. What I meant was, the function seems to be (I'm not really sure) redundant. The same thing can be done with the primitives addon.

The primitives addon only has a triangle rasterizer, while the MAP function is a parallelogram rasterizer (which will have to be rewritten into a generalized quadrangle rasterizer). Now, you can implement the latter using two triangle rasterizers, but in principle it is a separate function.

Thus, if rewritten, code duplication will be relatively minimal. Whether rewriting it is better than using the primitives addon's triangle rasterizer twice is another question. It should be more efficient, in principle to use a dedicated quadrangle rasterizer (it may be fun to benchmark the current implementations against each other). It is certainly faster (in terms of development time) to just use the primitives addon.


But anyhow, I can easily keep the current 2D transforms as they are
and create a 3D transform addon or something. I think it would work,
but the core would depend on it anyway I guess, since as I said, the
2D transformation API produced incorrect results (for whatever
reason)
when I first tried using it for the iPhone landscape transformation.
I
know that involves an orthographic projection which is a 3D thing,
but even when I temporarily removed it for testing, the comparison to
the OpenGL matrix was off, and all of the other transforms are 2D.

I'd say a general 4x4 matrix transformation is sufficiently standard
to use for our transformations API. Even Flash which is 100% 2D uses a full 4x4 matrix for transformations. So if at all possible I'd say we shouldn't limit the transformation API to 2D only.

The current transformations are 4x4 matrices, so it's only a matter of choice of what the functions do. The difference between sticking 3D functions into the addon vs the core is whether the core (specifically the aforementioned PARALLELOGRAM_MAP) supports the 3D transformations. If they are in the addon, the support is obviously optional.

-SiegeLord




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/