Re: [AD] Bug in clip3d_f() / polygon3d_f()

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


I just wanted to pipe up because I think you guys are making the whole
texture coordinate thing WAY too complicated.

For one thing, whether an integer texture coordinate maps to the
upperleft, lowerright, or middle of a texel is completely arbitrary.  It
is not important where it maps, it just has to be consistant and easy to
use in the context of everything else in the library.  This is just like
it is arbitrary whether the library is left or right handed, its just
important to be consistent and to document it.  What is important is that
we consistently apply the unit which we choose for texture coordinates.  
1 unit == 1 texel, OpenGL is 1 unit = 1 texture dimension, and Glide
(which is weird) uses 256 units = 1 texture dimension.

It simply does not matter where you map the integer values.  They actually
are not very special except that humans can understand 3 better than
3.1415 (and that I think Allegro only allowed u and v to be integers
IIRC).

A quad mapped from (0,0) - (0,32) - (32,32) - (32,0) is 32x32 in size.
Just imagine me drawing it with a ruler.  I start at 0 cm on the ruler,
and draw a line to 32 cm.  I don't get a 33 cm square rectangle.

Now, if I was to put a 32x32 cm square graph paper over the top of
it (a texture map if you will), It would not matter how I aligned it with
the square, 32x32 boxes will be 'mapped' into the square.

I think that one of you is confusing a polygonal quad with a quad drawn
with lines.  But you forget that line drawing and polygon drawing are
fundamentally different.  Lines are drawn through the centers of their
coordinates and they must have a thickness to be seen, so a polygon drawn
when them will always be bigger than the equivalent filled polygon.  It
will even be different than a polygon drawn in line mode (which allegro
doesn't have)

So, whether we align texels in the center (I know of no library that does
this), in the upper left like DX or the lower left like openGL is just a
matter of making a decision that fits and is easiest to use all other
things considered.

For Allegro, that means that the upper left corner of a texel should map
to integer coordinates.

A good document that helps explain some of this is at:
http://www.nvidia.com/Marketing/Developer/DevRel.nsf/bookmark/6856F3C0A06039B1882568CC007F48AA

I don't know if I did a better job of explaining it, but I tried ^_^



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