# Thread: Can concatenate projection matrix with viewport transformation matrix?

1. ## Can concatenate projection matrix with viewport transformation matrix?

As I understand it, the clip coords must first be divided with the Wc coord to yield NDC coords *before* the viewport transformation is applied...
However, the technique for projective textures calls for concatenating the projection matrix with the viewport transformation matrix(which consists of a scaling followed by a translation) into a single matrix which is then applied to the eye coords, finally performing perspective division with the Q coord to yield the actual texture coords.
Can this possibly be correct? I thought performing perspective division *after* viewport transformation would give different(and incorrect) results than performing perspective division *before* viewport transformation?

Puzzled.

2. ## Re: Can concatenate projection matrix with viewport transformation matrix?

Doesn't the projection matrix already include the perspective divide?

3. ## Re: Can concatenate projection matrix with viewport transformation matrix?

Well, while the element in the last row/third column being -1 accounts for Wc being -Ze, the perspective division of Xc, Yc & Zc by Wc must take place *before* the scaling/translation of the viewport transformation in order for the window coordinates to turn out correct....and not *after*, since matrix multiplication is not commutative.
Otherwise the red book wouldn't explicitly state that the perspective division takes place *after* projection transformation and *before* viewport transformation....might as well combine the 2 together and save an extra matrix multiplication altogether.
Not sure if this is correct or not...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•