binding or texture mapping
William Labbett

Hi,
when you just want to draw a bitmap onto a rectangular polygon is this called texture mapping or is it something else (binding perhaps) ?
Can someone point me to a tutorial for this kind of thing ?

will

orz

For Allegro, see
allegro/examples/ex3d.c
For OpenGL, see
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06
(and earlier lessons, to make sense out of that)

William Labbett

I have checked ex3D but it doesn't explain very much.

What if the bitmap to draw is a different size to the polygon.
What if the polygon's not a rectangle e.g a pentagon or a triangle ?

These are the things I'm wondering about.

orz

Perhaps you should try looking up the relevant functions in the Allegro manual under "Polygon rendering". The portion of the texture bitmap that appears on the polygon is probably controlled by a set of texture coordinates.

William Labbett

Okay, thanks for the help orz.

[edit]

I was reading ex3d.c and was confused as to why there's a typedef VTX. Couldn't the V3D type have been used ?

Thread #590198. Printed from Allegro.cc