Mail Archives: djgpp/1997/03/24/20:06:07
Quackerz writes:
>I'm still having a hard time using allegro for 3d. I cant even get it to
>draw one stupid triangle. I have only been programing for less then a
I posted an example that draws a simple poly on to the screen a couple
of weeks ago. Search the mail archives for "quad3d".
>frustrated. The Allegro V3D structure has also confused me. How can each
>vertex have texture mapping coordinates? I have many more questions.
The u/v coordinates are only relevant for texture mapped drawing modes
(duh :-) If you are using flat shaded or gouraud shaded polys, you can
just set them to zero. Texture coordinates are a tricky thing to get
your brain around at first, but they really aren't as complicated as
they seem. They simply define which part of the texture map (which is a
2d bitmap) should be drawn at that vertex. Say you have a 32x32 texture,
which is to be mapped onto a quad. If you give the first vertex u/v
coordinates which are both zero, that means the top left pixel of the
texture should be drawn at that location on the screen. If you give the
second vertex a u/v position of (31,0), that means the top right pixel
of the texture goes with the second vertex (and the middle part of the
texture is stretched to fill whatever gap lies between the two
vertices).
There are a couple of decent texture mapping tutorials on x2ftp, which
would be worth taking a look at...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -