Mail Archives: djgpp/1999/05/22/20:45:22
From: | Ryan Gumbs <gumby AT ao DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | problems with Allegro polygon3d_f and txtrmapping
|
Date: | 22 May 1999 12:21:11 GMT
|
Organization: | Access Orlando (407) 895-1200
|
Lines: | 44
|
Message-ID: | <7i67fn$9p9$1@news.ao.net>
|
NNTP-Posting-Host: | eola.ao.net
|
X-Trace: | news.ao.net 927375671 10025 205.244.242.15 (22 May 1999 12:21:11 GMT)
|
X-Complaints-To: | usenet AT ao DOT net
|
NNTP-Posting-Date: | 22 May 1999 12:21:11 GMT
|
User-Agent: | tin/pre-1.4-981002 ("Phobia") (UNIX) (Linux/2.2.1 (i586))
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
can anyone please tell me what is wrong with the code below.
i am trying to do txtr-mapping with allegro but i am getting
garbage when it draws the triangle. the image loads and
displays correctly but the triangle is screwed up.
i have spent hours looking at this and can't find out why its
not working.
thanx to anyone who can help.
Ryan Gumbs.
#include "allegro.h"
PALETTE pal;
V3D_f v[4]= {
{ 0, 0, 0, 0, 0},
{90, 0, 0, 90, 0},
{90, 90, 0, 90, 90},
{ 0, 90, 0, 0, 90},
};
V3D_f *pv[4]={v+0,v+1,v+2,v+3};
BITMAP *map, *buf;
void main() {
int i;
allegro_init();
set_color_conversion(COLORCONV_TOTAL);
set_color_depth(8);
map= load_bitmap("landtxtr.pcx", pal);
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
buf=create_bitmap(SCREEN_W, SCREEN_H);
set_palette(pal);
clear(buf);
blit (map, buf, 0, 0, 100, 100, map->w, map->h);
triangle3d_f (buf, POLYTYPE_ATEX, map, v+0, v+1, v+2);
//polygon3d_f (buf, POLYTYPE_ATEX, map, 3, pv);
blit(buf, screen,0,0,0,0,buf->w, buf->h);
getch();
allegro_exit();
}
- Raw text -