Path: utzoo!attcan!uunet!lll-winken!sun-barr!apple!turk
From: turk@Apple.COM (Ken "Turk" Turkowski)
Newsgroups: comp.graphics
Subject: Re: Texture mapping
Keywords: Texture mapping, convex quadrilaterals, triangles
Message-ID: <4495@internal.Apple.COM>
Date: 2 Oct 89 05:27:30 GMT
References: <9119@pyr.gatech.EDU> <4330@internal.Apple.COM>
Organization: Advanced Technology Graphics, Apple Computer, Cupertino, CA, USA
Lines: 32

In article <4330@internal.Apple.COM> turk@Apple.COM (that's me) write:
>For suitably well-behaved texture mappings (i.e. no bowtie
>quadrilaterals), there is a projective mapping, that maps quadrilaterals
>to quadrilaterals.  This is represented by a 3x3 matrix, unique up to a
>scale factor.
>
>	[x y z] = [uw vw w] [M]						(1)

Sorry, this is not quite true.  The 3x3 matrix actually represents a
projective mapping for triangles or an affine mapping for
quadrilaterals.  For the general case of an arbitrary mapping of
quadrilateral to quadrilateral, one needs a 3x4 matrix, as pointed out
in Paul Heckbert's master's thesis ("Fundamentals of Texture Mapping
and Image Warping", p. 23):

	[x y z h] = [uw vw w] [M]

Although Paul does not show the method for computing the 3x4 matrix, he
does show how to calculate the 3x3 matrix for mapping between arbitrary
quadrilaterals in the plane.  His method is similar to that of Penna
and Patterson's, in which one can easily determine a projective mapping
(of any degree) from the mapping of the "ideal points" (i.e. points at
infinity).

Anyway, the end result is the same: to find the (u,v) coordinates of a
polygon, you just plug (x,y,z) into a matrix equation and divide by the
homogeneous coordinate.
-- 
Ken Turkowski @ Apple Computer, Inc., Cupertino, CA
Internet: turk@apple.com
Applelink: TURKOWSKI1
UUCP: sun!apple!turk