delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/05/12:54:12

From: "Bengt-Åke Forslund" <bengtake DOT forslund AT vpress DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: PTEX polygon mapping - how are u/v coordinates written?
Date: Sun, 5 Sep 1999 15:26:11 +0200
Organization: Telenordia
Lines: 32
Message-ID: <7qtr2g$ng4$1@cubacola.tninet.se>
NNTP-Posting-Host: du64-229.ppp.mh-anst.tninet.se
X-Trace: cubacola.tninet.se 936538000 24068 195.100.229.64 (5 Sep 1999 13:26:40 GMT)
X-Complaints-To: abuse AT algo DOT net
NNTP-Posting-Date: 5 Sep 1999 13:26:40 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Respected comp.os.msdos.djgpp attenders,

I got Allegro and DJGPP running, and after some time managed to make the
Allegro 3D routines work somewhat also. One problem still alludes me,
though.

Basically, I try to do perspective correct texture mapping of a polygon
consisting of an array of vertices.

What I do is declaring the vertices involved in a particular polygon as
float numbers, where the typical polygon is some 128 x 64 units of size (and
with coordinates then like - 64, 64; - 64, 0; 64, 0; 64, 64). I do the same
with the texture coordinates u and v of each vertex and utilizes a 64 x 64
bitmap loaded from a .pcx file for texture. The loading of the .pcx appears
to function as it should, in any case it is displayed properly when I simply
blit it to the screen.

The embryonic engine takes the vertices, applies a camera matrix to them,
clips them and perspective projects them. Then they are fed into the
polygon3d_f function, with the PTEX mode parameter.

However, the texture mapping just gives weird results. Does anyone have any
clue as to why this? Could it be that I am missing some requirement put upon
the declaration of u and v coordinates?

Yours hopefully gratefully,

Kristoffer Forslund
jeanpaulsartre AT hotmail DOT com
listen.to/analysis


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019