Re: [AD] Meaning of the texture coordinates for the primitives addon

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


On 2009-09-06, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Sun, Sep 6, 2009 at 4:39 PM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> 
> > No takers?  Scaling a bitmap is obviously just a subset of texture
> > mapping, so I think this makes sense.  Most of the time you want to
> > scale the whole of a source bitmap, so it would be more convenient
> > to pass (0,0,1,1) instead of (0,0,sw,sh), too.
> >
> 
> But why do you want to use different coordinates for target and source?

My thinking is that, like texture mapping, the user knows which pixels
on the destination bitmap he wants to cover, but doesn't particularly
care which source pixels map to which destination pixels.  So the source
bitmap could be any size, and the size could change, but as long as the
whole source bitmap is used it's fine.

> Always using pixels for *target* and always using normalized for *source*
> coordinates is a possibility, but as my example above shows, it's a bit
> confusing.

Indeed, it is ugly for some situations.

> So, I still think we should use pixels everywhere, but allow the user to
> easily change it (with al_use_transform).

Well, my objection is still that routines which are meant to work with
either convention will need to explicitly set the transform and restore
it afterwards.  Probably that won't be done, and those routines will
just not work when someone tries to use it with a different transform.
It's certainly not the first part of the API with that problem, and I
don't know how important it is.

Peter




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